]> granicus.if.org Git - icinga2/commitdiff
Fix master zone name
authorJean Flach <jean-marcel.flach@netways.de>
Tue, 24 Nov 2015 13:32:07 +0000 (14:32 +0100)
committerJean Flach <jean-marcel.flach@netways.de>
Tue, 24 Nov 2015 13:32:07 +0000 (14:32 +0100)
fixes #10716

lib/cli/nodeutility.cpp

index bd77c2679564b59c14b509f092bfcb0f194289e7..fd44710b09ef5616520d7d41d324b289e92dd9a7 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "cli/nodeutility.hpp"
 #include "cli/clicommand.hpp"
+#include "cli/variableutility.hpp"
 #include "base/logger.hpp"
 #include "base/application.hpp"
 #include "base/tlsutility.hpp"
@@ -314,6 +315,7 @@ int NodeUtility::GenerateNodeIcingaConfig(const std::vector<std::string>& endpoi
        my_zone->Set("__name", zonename);
        my_zone->Set("__type", "Zone");
        my_zone->Set("parent", master_zone_name); //set the master zone as parent
+
        my_zone->Set("// This is the local node", nodename);
        my_zone->Set("endpoints", my_zone_members);
 
@@ -343,9 +345,11 @@ int NodeUtility::GenerateNodeMasterIcingaConfig(const String& nodename)
 
        my_master_zone_members->Add(nodename);
 
-       my_master_zone->Set("__name", "master");
+       String zonename = VariableUtility::GetVariable("ZoneName");
+
+       my_master_zone->Set("__name", zonename);
        my_master_zone->Set("__type", "Zone");
-       my_master_zone->Set("// This is the local master zone", "master");
+       my_master_zone->Set("// This is the local master zone", zonename);
        my_master_zone->Set("endpoints", my_master_zone_members);
 
        /* store the local config */