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:
Michael Friedrich 2018-09-28 09:31:07 +02:00 committed by GitHub
commit 1cae040274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 4 deletions

View File

@ -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));