[icinga-checkins] icinga.org: icingaweb2-module-director/feature/import-templates-11778: Sync: Allow importing / syncing templates

git at icinga.org git at icinga.org
Wed Oct 26 16:40:52 CEST 2016


Module: icingaweb2-module-director
Branch: feature/import-templates-11778
Commit: 2295078bd2ebdccd75a335d6a5bb0dba2d249b2e
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=2295078bd2ebdccd75a335d6a5bb0dba2d249b2e

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 28fc482..6843406 100644
--- a/library/Director/Import/Sync.php
+++ b/library/Director/Import/Sync.php
@@ -552,17 +552,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