Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icinga2 pki ticket: print hint if --salt missing #8070

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/cli/pkiticketcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,18 @@ int PKITicketCommand::Run(const boost::program_options::variables_map& vm, const
}

String salt = VariableUtility::GetVariable("TicketSalt");
bool noSaltInVars = salt.IsEmpty();

if (vm.count("salt"))
salt = vm["salt"].as<std::string>();

if (salt.IsEmpty()) {
Log(LogCritical, "cli", "Ticket salt (--salt) must be specified.");
Log log (LogCritical, "cli", "Ticket salt (--salt) must be specified.");

if (noSaltInVars) {
log << " (Did you run 'icinga2 node wizard/setup' and 'icinga2 daemon -C' first?)";
}

return 1;
}

Expand Down
Loading