[icinga-checkins] icinga.org: icingaweb2-module-director/feature/test-runner-12905: Sync: Allow importing / syncing templates

git at icinga.org git at icinga.org
Wed Nov 2 19:31:05 CET 2016


Module: icingaweb2-module-director
Branch: feature/test-runner-12905
Commit: b04e5f401f27df8190893f14d8fdf30aaef96b91
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=b04e5f401f27df8190893f14d8fdf30aaef96b91

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Wed Oct 26 16:40:48 2016 +0200

Sync: Allow importing / syncing templates

Purging a used template will obviously fail.

refs #11778

---

 library/Director/Import/Sync.php |   11 -----------
 1 file changed, 11 deletions(-)

diff --git a/library/Director/Import/Sync.php b/library/Director/Import/Sync.php
index a8fe247..b81693b 100644
--- a/library/Director/Import/Sync.php
+++ b/library/Director/Import/Sync.php
@@ -565,17 +565,6 @@ class Sync
             $modified = 0;
             $deleted = 0;
             foreach ($objects as $object) {
-                if ($object instanceof IcingaObject && $object->isTemplate()) {
-                    // TODO: allow to sync templates
-                    if ($object->hasBeenModified()) {
-                        throw new IcingaException(
-                            'Sync is not allowed to modify template "%s"',
-                            $object->object_name
-                        );
-                    }
-                    continue;
-                }
-
                 if ($object->shouldBeRemoved()) {
                     $object->delete($db);
                     $deleted++;



More information about the icinga-checkins mailing list