From 3411aa4993f0cd5391c74beee3eecbb3cec8d776 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 21 Aug 2007 14:13:12 -0400 Subject: Patch to allow snippets to be commented out in kickstart templates --- cobbler/action_sync.py | 9 +++++++-- 1 file 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 -- cgit