Please consider the attached patch for inclusion in koan
This patch adds support for file names to the --no-cobbler option.
-gavin...
This patch adds support for file names to the --no-cobbler option.
The current --no-cobbler option expects a URL value (which can be an http:,
ftp:, nfs:, or file: URL). The patch adds some smarts to the --no-cobbler
option so that if no URL protocol is specified, it assumes file:. This
means that the --no-cobbler option handles both file names (relative or
absolute), and URLs. Note that this patch as no effect on kickstart names
that koan gets from cobbler, just the names it gets from the --no-cobbler
option.
* Mon Feb 11 2008 Gavin Romig-Koch <[EMAIL PROTECTED]>
- have the --no-cobbler option handle file names in addition to URL names
diff --git a/koan/app.py b/koan/app.py
index 1c77103..78a9e30 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -538,7 +538,22 @@ class Koan:
filler = None
if self.no_cobbler:
- profile_data["kickstart"] = self.no_cobbler
+ # if the value given to no_cobbler has no url protocol
+ # specifier, add "file:" and make it absolute
+
+ slash_idx = self.no_cobbler.find("/")
+ if slash_idx != -1:
+ colon_idx = self.no_cobbler.find(":",0,slash_idx)
+ else:
+ colon_idx = self.no_cobbler.find(":")
+
+ if colon_idx == -1:
+ # no protocol specifier
+ profile_data["kickstart"] = "file:%s" % os.path.abspath(self.no_cobbler)
+
+ else:
+ # protocol specifier
+ profile_data["kickstart"] = self.no_cobbler
if profile_data.has_key("kickstart"):
_______________________________________________
et-mgmt-tools mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/et-mgmt-tools