diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-11-16 16:09:27 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-11-16 16:09:27 -0500 |
commit | 3a1e1828c5fb1716fa07856b0744e40923133297 (patch) | |
tree | 64159d56415d1c929226f8ffa250c8ce04f2e971 /cobbler/collection_distros.py | |
parent | 7f07008198e5ec6c6d1c4e2d6809e2870b3809d0 (diff) | |
download | third_party-cobbler-3a1e1828c5fb1716fa07856b0744e40923133297.tar.gz third_party-cobbler-3a1e1828c5fb1716fa07856b0744e40923133297.tar.xz third_party-cobbler-3a1e1828c5fb1716fa07856b0744e40923133297.zip |
Applying Ben Riggs patch to add API flag to disable triggers when adding
objects.
Diffstat (limited to 'cobbler/collection_distros.py')
-rw-r--r-- | cobbler/collection_distros.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cobbler/collection_distros.py b/cobbler/collection_distros.py index b696738..b415766 100644 --- a/cobbler/collection_distros.py +++ b/cobbler/collection_distros.py @@ -31,7 +31,7 @@ class Distros(collection.Collection): """ return distro.Distro(config).from_datastruct(seed_data) - def remove(self,name,with_delete=True): + def remove(self,name,with_delete=True,with_triggers=True): """ Remove element named 'name' from the collection """ @@ -43,13 +43,13 @@ class Distros(collection.Collection): obj = self.find(name=name) if obj is not None: if with_delete: - self._run_triggers(obj, "/var/lib/cobbler/triggers/delete/distro/pre/*") + if with_triggers: self._run_triggers(obj, "/var/lib/cobbler/triggers/delete/distro/pre/*") lite_sync = action_litesync.BootLiteSync(self.config) lite_sync.remove_single_profile(name) del self.listing[name] self.config.serialize_delete(self, obj) if with_delete: - self._run_triggers(obj, "/var/lib/cobbler/triggers/delete/distro/post/*") + if with_triggers: self._run_triggers(obj, "/var/lib/cobbler/triggers/delete/distro/post/*") return True raise CX(_("cannot delete object that does not exist")) |