summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/action_sync.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index 40419c8..a051828 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -149,7 +149,8 @@ class BootSync:
system_definitions = ""
counter = 0
for system in self.systems:
- if not system.get_mac_address() != "":
+ mac = system.get_mac_address()
+ if mac is None or mac == "":
# can't write a DHCP entry for this system
# FIXME: should this be a warning?
pass
@@ -170,7 +171,7 @@ class BootSync:
if distro.arch == "ia64":
# can't use pxelinux.0 anymore
systxt = systxt + " filename \"/%s\";\n" % elilo
- systxt = systxt + " hardware ethernet %s;\n" % system.get_mac_address()
+ systxt = systxt + " hardware ethernet %s;\n" % mac
if system.get_ip_address() != None:
systxt = systxt + " fixed-address %s;\n" % system.get_ip_address()
systxt = systxt + " next-server %s;\n" % self.settings.next_server
@@ -494,8 +495,13 @@ class BootSync:
# replace contents of the data stream with items from the snippet cache
# do not use Cheetah yet, Cheetah can't really be run twice on the same
# stream and be expected to do the right thing
- for x in self.snippet_cache:
- data = data.replace("SNIPPET::%s" % x, self.snippet_cache[x])
+ newdata = ""
+ for line in data.split("\n"):
+ for x in self.snippet_cache:
+ if not line.startswith("#"):
+ line = line.replace("SNIPPET::%s" % x, self.snippet_cache[x])
+ newdata = "\n".join((newdata, line))
+ data = newdata
# HACK: the ksmeta field may contain nfs://server:/mount in which
# case this is likely WRONG for kickstart, which needs the NFS