summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@mdehaan.rdu.redhat.com>2007-08-21 14:13:12 -0400
committerroot <root@mdehaan.rdu.redhat.com>2007-08-21 14:13:12 -0400
commit3411aa4993f0cd5391c74beee3eecbb3cec8d776 (patch)
tree1388a070962d50a715c6104eeb1495cdf6025ed2
parent001e21dd52d82c6984376f52470ff10ba50374e2 (diff)
downloadthird_party-cobbler-3411aa4993f0cd5391c74beee3eecbb3cec8d776.tar.gz
third_party-cobbler-3411aa4993f0cd5391c74beee3eecbb3cec8d776.tar.xz
third_party-cobbler-3411aa4993f0cd5391c74beee3eecbb3cec8d776.zip
Patch to allow snippets to be commented out in kickstart templates
-rw-r--r--cobbler/action_sync.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index 40419c8..77c0755 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -494,8 +494,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