summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-08-06 16:27:39 -0400
committerMichael DeHaan <mdehaan@redhat.com>2007-08-06 16:27:39 -0400
commita2127ce1c5b7ed06662893eb93753b589a8740be (patch)
tree6b8d44956017ac3eed7fd09e6e8d9b7968c3cf9b /cobbler
parent90893450507ea32244019ff2e4ff94e52605fc4d (diff)
downloadthird_party-cobbler-a2127ce1c5b7ed06662893eb93753b589a8740be.tar.gz
third_party-cobbler-a2127ce1c5b7ed06662893eb93753b589a8740be.tar.xz
third_party-cobbler-a2127ce1c5b7ed06662893eb93753b589a8740be.zip
Make cobbler write out correct NFS directives even when metadata
references NFS in URL form.
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/action_sync.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index bc587be..2fc767b 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -490,7 +490,23 @@ class BootSync:
# 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])
-
+
+ # HACK: the ksmeta field may contain nfs://server:/mount in which
+ # case this is likely WRONG for kickstart, which needs the NFS
+ # directive instead. Do this to make the templates work.
+ newdata = ""
+ if metadata.has_key("tree"):
+ for line in data.split("\n"):
+ if line.find("--url") != -1 and line.find("url ") != -1:
+ rest = metadata["tree"][6:] # strip off "nfs://" part
+ (server, dir) = rest.split(":",2)
+ line = "nfs --server %s --dir %s" % (server,dir)
+ # but put the URL part back in so koan can still see
+ # what the original value was
+ line = line + "\n" + "#url --url %s" % metadata["tree"]
+ newdata = newdata + line + "\n"
+ data = newdata
+
# tell Cheetah not to blow up if it can't find a symbol for something
data = "#errorCatcher Echo\n" + data