]> granicus.if.org Git - icinga2/commitdiff
Pass the zonesVar override around
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 27 Sep 2018 16:49:49 +0000 (18:49 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 19 Jun 2019 12:46:11 +0000 (14:46 +0200)
lib/cli/daemonutility.cpp
lib/remote/apilistener-filesync.cpp

index 802f1e758d3902a007f7da1670db6de115824c50..fcf0cc50d338b4316d69a12db6a63c3d45a556da 100644 (file)
@@ -143,14 +143,14 @@ bool DaemonUtility::ValidateConfigFiles(const std::vector<std::string>& 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)
index 1ae461d747fa3f83d65cedaac43a24b4a0898e2f..52203f9d1c56fffba1df2c478ed5994ce783f431 100644 (file)
@@ -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));