In Ubuntu/Debian distros the install_tree cannot be obtained from a
kickstart file, as preseed files are used instead. This patch adds
the functionality of obtaining the install tree for Ubuntu/Debian
in a different approach, using the url provided in ks_meta.
---
koan/app.py | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/koan/app.py b/koan/app.py
index 5b4c7fc..d8f5d3a 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -491,8 +491,13 @@ class Koan:
else:
profile_data["kickstart"] =
"http://%s/cblr/svc/op/ks/system/%s" % (profile_data['http_server'],
profile_data['name'])
- # find_kickstart source tree in the kickstart file
- self.get_install_tree_from_kickstart(profile_data)
+ # If breed is ubuntu/debian we need to source the install tree differently
+ # as preseeds are used instead of kickstarts.
+ if profile_data["breed"] in [ "ubuntu",
"debian" ]:
+ self.get_install_tree_for_debian_ubuntu(profile_data)
+ else:
+ # find_kickstart source tree in the kickstart file
+ self.get_install_tree_from_kickstart(profile_data)
# if we found an install_tree, and we don't have a kernel or initrd
# use the ones in the install_tree
@@ -665,6 +670,26 @@ class Koan:
#---------------------------------------------------
+ def get_install_tree_for_debian_ubuntu(self, profile_data):
+ """
+ Split ks_meta to obtain the tree path. Generate the install_tree
+ using the http_server and the tree obtained from splitting ks_meta
+
+ """
+
+ try:
+ tree = profile_data["ks_meta"].split("@(a)")[-1].strip()
+ profile_data["install_tree"] = "http://" +
profile_data["http_server"] + tree
+
+ if self.safe_load(profile_data,"install_tree"):
+ print "install_tree:", profile_data["install_tree"]
+ else:
+ print "warning: kickstart found but no install_tree found"
+ except:
+ pass
+
+ #---------------------------------------------------
+
def list(self,what):
if what not in [ "images", "profiles", "systems",
"distros", "repos" ]:
raise InfoException("koan does not know how to list that")
--
1.7.4.1
Show replies by date