[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaObject: fix arguments rendering for external

git at icinga.org git at icinga.org
Tue Oct 25 04:39:59 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: fa2c360f4c2c3b96b33db546e68229c82d60d7ff
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=fa2c360f4c2c3b96b33db546e68229c82d60d7ff

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue Oct 25 02:28:19 2016 +0000

IcingaObject: fix arguments rendering for external

...objects

---

 library/Director/Objects/IcingaObject.php |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 7c68d14..438eceb 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1378,8 +1378,10 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
         $config = new IcingaConfig($this->connection);
         $object = $this;
         if ($object->isExternal()) {
-            $object = clone($object);
             $object->object_type = 'object';
+            $wasExternal = true;
+        } else {
+            $wasExternal = false;
         }
 
         try {
@@ -1392,6 +1394,9 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
                 . '/*  ' . $e->getMessage() . ' */'
             );
         }
+        if ($wasExternal) {
+            $object->object_type = 'external_object';
+        }
 
         return $config;
     }



More information about the icinga-checkins mailing list