diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-10-24 15:38:47 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-10-24 15:38:47 -0400 |
commit | ed3873ed40ccde84ec18e27a7aa43147269056fa (patch) | |
tree | 16e2e12e17747ba3dc144553b4271366720dc556 | |
parent | 54576ea6633c71aaa2787122cc56980641533c69 (diff) | |
download | third_party-cobbler-ed3873ed40ccde84ec18e27a7aa43147269056fa.tar.gz third_party-cobbler-ed3873ed40ccde84ec18e27a7aa43147269056fa.tar.xz third_party-cobbler-ed3873ed40ccde84ec18e27a7aa43147269056fa.zip |
Call deserialize after the pre-sync triggers are run to allow those triggers to insert or modify additional cobbler objects,
such as via LDAP, despite not sharing the API handle since they are called out of process.
-rw-r--r-- | cobbler/action_sync.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index 9da375f..7efa0b5 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -60,9 +60,21 @@ class BootSync: Syncs the current configuration file with the config tree. Using the Check().run_ functions previously is recommended """ - utils.run_triggers(None, "/var/lib/cobbler/triggers/sync/pre/*") if not os.path.exists(self.settings.tftpboot): raise CX(_("cannot find directory: %s") % self.settings.tftpboot) + + # run pre-triggers... + utils.run_triggers(None, "/var/lib/cobbler/triggers/sync/pre/*") + + # in case the pre-trigger modified any objects... + self.api.deserialize() + self.distros = self.config.distros() + self.profiles = self.config.profiles() + self.systems = self.config.systems() + self.settings = self.config.settings() + self.repos = self.config.repos() + + # execute the core of the sync operation self.clean_trees() self.copy_bootloaders() self.copy_distros() @@ -74,6 +86,8 @@ class BootSync: self.regen_ethers() self.regen_hosts() self.make_pxe_menu() + + # run post-triggers utils.run_triggers(None, "/var/lib/cobbler/triggers/sync/post/*") return True |