mirror of https://github.com/Icinga/icinga2.git
Pass the zonesVar override around
This commit is contained in:
parent
2ed56b50a4
commit
1853254201
|
@ -143,14 +143,14 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Load cluster synchronized configuration files. This can be disabled for staged sync validations. */
|
/* Load cluster synchronized configuration files. This can be disabled for staged sync validations. */
|
||||||
bool ignoreZonesVarDir = false;
|
|
||||||
if (systemNS->Contains("IgnoreZonesVarDir")) {
|
|
||||||
ignoreZonesVarDir = Convert::ToBool(systemNS->Get("IgnoreZonesVarDir"));
|
|
||||||
}
|
|
||||||
|
|
||||||
String zonesVarDir = Configuration::DataDir + "/api/zones";
|
String zonesVarDir = Configuration::DataDir + "/api/zones";
|
||||||
|
|
||||||
if (!ignoreZonesVarDir && Utility::PathExists(zonesVarDir))
|
/* Cluster config sync stage validation needs this. */
|
||||||
|
if (systemNS->Contains("ZonesStageVarDir")) {
|
||||||
|
zonesVarDir = systemNS->Get("ZonesStageVarDir");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Utility::PathExists(zonesVarDir))
|
||||||
Utility::Glob(zonesVarDir + "/*", std::bind(&IncludeNonLocalZone, _1, "_cluster", std::ref(success)), GlobDirectory);
|
Utility::Glob(zonesVarDir + "/*", std::bind(&IncludeNonLocalZone, _1, "_cluster", std::ref(success)), GlobDirectory);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
|
|
|
@ -396,7 +396,7 @@ void ApiListener::AsyncTryActivateZonesStage(const String& stageConfigDir, const
|
||||||
"daemon",
|
"daemon",
|
||||||
"--validate",
|
"--validate",
|
||||||
"--define",
|
"--define",
|
||||||
"System.IgnoreZonesVarDir=true"
|
"System.ZonesStageVarDir='" + GetApiZonesStageDir() + "'" //Path is written onto the shell
|
||||||
});
|
});
|
||||||
|
|
||||||
Process::Ptr process = new Process(Process::PrepareCommand(args));
|
Process::Ptr process = new Process(Process::PrepareCommand(args));
|
||||||
|
|
Loading…
Reference in New Issue