diff --git a/lib/cli/daemonutility.cpp b/lib/cli/daemonutility.cpp index b586544ee..802f1e758 100644 --- a/lib/cli/daemonutility.cpp +++ b/lib/cli/daemonutility.cpp @@ -100,6 +100,10 @@ static void IncludePackage(const String& packagePath, bool& success) bool DaemonUtility::ValidateConfigFiles(const std::vector& 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& 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)); diff --git a/lib/remote/apilistener-filesync.cpp b/lib/remote/apilistener-filesync.cpp index 68b96b9df..f1d590293 100644 --- a/lib/remote/apilistener-filesync.cpp +++ b/lib/remote/apilistener-filesync.cpp @@ -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));