mirror of https://github.com/Icinga/icinga2.git
Merge pull request #6546 from WuerthPhoenix/fix/define-switches-not-passed-during-config-test
Overridden path constants not passed to config validation in /v1/config/stages API call
This commit is contained in:
commit
1cae040274
|
@ -217,12 +217,23 @@ void ConfigPackageUtility::AsyncTryActivateStage(const String& packageName, cons
|
|||
// prepare arguments
|
||||
Array::Ptr args = new Array({
|
||||
Application::GetExePath(Application::GetArgV()[0]),
|
||||
"daemon",
|
||||
"--validate",
|
||||
"--define",
|
||||
"ActiveStageOverride=" + packageName + ":" + stageName
|
||||
});
|
||||
|
||||
// copy all arguments of parent process
|
||||
for (int i = 1; i < Application::GetArgC(); i++) {
|
||||
String argV = Application::GetArgV()[i];
|
||||
|
||||
if (argV == "-d" || argV == "--daemonize")
|
||||
continue;
|
||||
|
||||
args->Add(argV);
|
||||
}
|
||||
|
||||
// add arguments for validation
|
||||
args->Add("--validate");
|
||||
args->Add("--define");
|
||||
args->Add("ActiveStageOverride=" + packageName + ":" + stageName);
|
||||
|
||||
Process::Ptr process = new Process(Process::PrepareCommand(args));
|
||||
process->SetTimeout(300);
|
||||
process->Run(std::bind(&TryActivateStageCallback, _1, packageName, stageName, reload));
|
||||
|
|
Loading…
Reference in New Issue