From: Michael Friedrich Date: Thu, 27 Sep 2018 16:49:49 +0000 (+0200) Subject: Pass the zonesVar override around X-Git-Tag: v2.11.0-rc1~59^2~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18532542014bdb4518433ee2d607d38922de4751;p=icinga2 Pass the zonesVar override around --- diff --git a/lib/cli/daemonutility.cpp b/lib/cli/daemonutility.cpp index 802f1e758..fcf0cc50d 100644 --- a/lib/cli/daemonutility.cpp +++ b/lib/cli/daemonutility.cpp @@ -143,14 +143,14 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector& configs, return false; /* 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 (!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); if (!success) diff --git a/lib/remote/apilistener-filesync.cpp b/lib/remote/apilistener-filesync.cpp index 1ae461d74..52203f9d1 100644 --- a/lib/remote/apilistener-filesync.cpp +++ b/lib/remote/apilistener-filesync.cpp @@ -396,7 +396,7 @@ void ApiListener::AsyncTryActivateZonesStage(const String& stageConfigDir, const "daemon", "--validate", "--define", - "System.IgnoreZonesVarDir=true" + "System.ZonesStageVarDir='" + GetApiZonesStageDir() + "'" //Path is written onto the shell }); Process::Ptr process = new Process(Process::PrepareCommand(args));