From 4c77a32ee0b0b1bea0425ba07501f880ab317721 Mon Sep 17 00:00:00 2001
From: Thomas Gelf <thomas@gelf.net>
Date: Fri, 4 May 2018 08:45:32 +0200
Subject: [PATCH] IcingaConfig: remove hard-coded global zone

Anyways, this line should be obsolete
---
 library/Director/IcingaConfig/IcingaConfig.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php
index 68ed7ab9..06d7fcff 100644
--- a/library/Director/IcingaConfig/IcingaConfig.php
+++ b/library/Director/IcingaConfig/IcingaConfig.php
@@ -445,7 +445,6 @@ class IcingaConfig
     protected function generateFromDb()
     {
         PrefetchCache::initialize($this->connection);
-
         $start = microtime(true);
 
         MemoryLimit::raiseTo('1024M');
@@ -478,8 +477,10 @@ class IcingaConfig
             ;
 
         if (! $this->isLegacy()) {
-            $this->configFile('zones.d/director-global/commands')
-                ->prepend("library \"methods\"\n\n");
+            $this->configFile(sprintf(
+                'zones.d/%s/commands',
+                $this->connection->getDefaultGlobalZoneName()
+            ))->prepend("library \"methods\"\n\n");
         }
 
         PrefetchCache::forget();