From 9413c8cdbde29add88ecf433c52ec61247e47f64 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 1 Dec 2015 14:47:10 +0100 Subject: [PATCH] IcingaConfig: do not re-deploy external objects --- library/Director/IcingaConfig/IcingaConfig.php | 4 +++- library/Director/Objects/IcingaObject.php | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php index 40367a7b..09d17f33 100644 --- a/library/Director/IcingaConfig/IcingaConfig.php +++ b/library/Director/IcingaConfig/IcingaConfig.php @@ -310,7 +310,9 @@ throw $e; $file = null; foreach ($objects as $object) { - if ($object->isTemplate()) { + if ($object->isExternal()) { + continue; + } elseif ($object->isTemplate()) { $filename = strtolower($type) . '_templates'; $zone = 'master'; } else { diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index 3d2645d3..8c09fded 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -494,6 +494,12 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer && $this->object_type === 'template'; } + public function isExternal() + { + return $this->hasProperty('object_type') + && $this->object_type === 'external_object'; + } + public function isApplyRule() { return $this->hasProperty('object_type')