diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-10-17 18:11:51 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-10-17 18:11:51 -0400 |
commit | 4a7d0c46c7dd4ab46a4850bd462729d1ea6be497 (patch) | |
tree | 918f0f0b66de6cda083d8dd3d888fd7589c24cba /cobbler/collection_distros.py | |
parent | 940a0bbbe44db52c06514423823f865a6c579e3a (diff) | |
download | third_party-cobbler-4a7d0c46c7dd4ab46a4850bd462729d1ea6be497.tar.gz third_party-cobbler-4a7d0c46c7dd4ab46a4850bd462729d1ea6be497.tar.xz third_party-cobbler-4a7d0c46c7dd4ab46a4850bd462729d1ea6be497.zip |
Various changes to allow for increased performance in the WebUI and in saving state, plus
a fix to import that keeps from creating extra yum repo entries for various distros.
Diffstat (limited to 'cobbler/collection_distros.py')
-rw-r--r-- | cobbler/collection_distros.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/cobbler/collection_distros.py b/cobbler/collection_distros.py index 00e543d..5f54881 100644 --- a/cobbler/collection_distros.py +++ b/cobbler/collection_distros.py @@ -20,8 +20,6 @@ from cexceptions import * import action_litesync from rhpl.translate import _, N_, textdomain, utf8 -TESTMODE = False - class Distros(collection.Collection): def collection_type(self): @@ -33,16 +31,7 @@ class Distros(collection.Collection): """ return distro.Distro(config).from_datastruct(seed_data) - def filename(self): - """ - Config file for distro serialization - """ - if TESTMODE: - return "/var/lib/cobbler/test/distros" - else: - return "/var/lib/cobbler/distros" - - def remove(self,name,with_delete=False): + def remove(self,name,with_delete=True): """ Remove element named 'name' from the collection """ @@ -51,11 +40,14 @@ class Distros(collection.Collection): for v in self.config.profiles(): if v.distro.lower() == name: raise CX(_("removal would orphan profile: %s") % v.name) - if self.find(name=name): + obj = self.find(name=name) + if obj is not None: if with_delete: self._run_triggers(self.listing[name], "/var/lib/cobbler/triggers/delete/distro/pre/*") lite_sync = action_litesync.BootLiteSync(self.config) lite_sync.remove_single_profile(name) + self.config.serialize_delete(self, obj) + if with_delete: self._run_triggers(self.listing[name], "/var/lib/cobbler/triggers/delete/distro/post/*") del self.listing[name] return True |