mirror of https://github.com/Icinga/icinga2.git
Better signal for checking the cluster config sync stage (ignore production)
This commit is contained in:
parent
506eee2f7d
commit
c2d7063ae7
|
@ -100,6 +100,10 @@ static void IncludePackage(const String& packagePath, bool& success)
|
|||
bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs, const String& objectsFile)
|
||||
{
|
||||
bool success;
|
||||
|
||||
Namespace::Ptr systemNS = ScriptGlobal::Get("System");
|
||||
VERIFY(systemNS);
|
||||
|
||||
if (!objectsFile.IsEmpty())
|
||||
ConfigCompilerContext::GetInstance()->OpenObjectsFile(objectsFile);
|
||||
|
||||
|
@ -138,17 +142,20 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& configs,
|
|||
if (!success)
|
||||
return false;
|
||||
|
||||
/* Load cluster synchronized configuration files */
|
||||
/* 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";
|
||||
if (Utility::PathExists(zonesVarDir))
|
||||
|
||||
if (!ignoreZonesVarDir && Utility::PathExists(zonesVarDir))
|
||||
Utility::Glob(zonesVarDir + "/*", std::bind(&IncludeNonLocalZone, _1, "_cluster", std::ref(success)), GlobDirectory);
|
||||
|
||||
if (!success)
|
||||
return false;
|
||||
|
||||
Namespace::Ptr systemNS = ScriptGlobal::Get("System");
|
||||
VERIFY(systemNS);
|
||||
|
||||
/* This is initialized inside the IcingaApplication class. */
|
||||
Value vAppType;
|
||||
VERIFY(systemNS->Get("ApplicationType", &vAppType));
|
||||
|
|
|
@ -391,7 +391,7 @@ void ApiListener::AsyncTryActivateZonesStage(const String& stageConfigDir, const
|
|||
"daemon",
|
||||
"--validate",
|
||||
"--define",
|
||||
"ZonesDir=" + GetApiZonesStageDir()
|
||||
"System.IgnoreZonesVarDir=true"
|
||||
});
|
||||
|
||||
Process::Ptr process = new Process(Process::PrepareCommand(args));
|
||||
|
|
Loading…
Reference in New Issue