diff options
Diffstat (limited to 'cobbler')
-rw-r--r-- | cobbler/action_litesync.py | 12 | ||||
-rw-r--r-- | cobbler/action_sync.py | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/cobbler/action_litesync.py b/cobbler/action_litesync.py index 2560d8d..d86962f 100644 --- a/cobbler/action_litesync.py +++ b/cobbler/action_litesync.py @@ -112,15 +112,17 @@ class BootLiteSync: # delete system YAML file in systems/$name in webdir self.sync.rmfile(os.path.join(self.settings.webdir, "systems", name)) # delete contents of kickstarts_sys/$name in webdir - if system_record.is_pxe_supported(): - filename = utils.get_config_filename(system_record) - self.sync.rmtree(os.path.join(self.settings.webdir, "kickstarts_sys", filename)) + system_record = self.systems.find(name=name) + filename = utils.get_config_filename(system_record) + self.sync.rmtree(os.path.join(self.settings.webdir, "kickstarts_sys", filename)) + + if not system_record.is_pxe_supported(): + # no need to go any further with PXE cleanup + return # delete PXE Linux configuration file (which might be in one of two places) itanic = False - system_record = self.systems.find(name=name) profile = self.profiles.find(name=system_record.profile) - # allow cobbler deletes to still work in the cobbler config is discombobulated if profile is not None: distro = self.distros.find(name=profile.distro) if distro is not None and distro in [ "ia64", "IA64"]: diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index a051828..cd13cdf 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -686,7 +686,7 @@ class BootSync: if system is not None and kickstart_path.startswith("/"): # pxe_fn = utils.get_config_filename(system) kickstart_path = "http://%s/cblr/kickstarts_sys/%s/ks.cfg" % (self.settings.server, system.name) - elif kickstart_path.startswith("/") or kickstart_path.find(name="/cobbler/kickstarts/") != -1: + elif kickstart_path.startswith("/") or kickstart_path.find("/cobbler/kickstarts/") != -1: kickstart_path = "http://%s/cblr/kickstarts/%s/ks.cfg" % (self.settings.server, profile.name) if distro.breed is None or distro.breed == "redhat": |