summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-08-21 14:36:20 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-08-21 14:36:20 -0400
commit0d191065bc6e293448ce3c1114b2f716a30fc4ae (patch)
tree5143ab7be4762d44693b8b4de92c1c978405db01 /cobbler
parent8bcdf9fc47e9cbc90c3a04a5a552608971d7db62 (diff)
downloadthird_party-cobbler-0d191065bc6e293448ce3c1114b2f716a30fc4ae.tar.gz
third_party-cobbler-0d191065bc6e293448ce3c1114b2f716a30fc4ae.tar.xz
third_party-cobbler-0d191065bc6e293448ce3c1114b2f716a30fc4ae.zip
Bugfixing for deleting systems that are not named after MAC addresses.
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/action_litesync.py12
-rw-r--r--cobbler/action_sync.py2
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":