koan
koan copied to clipboard
What is the "autoinst" variable in profile_data supposed to be?
There is no "autoinst" entry in the Cobbler profile variables, and so the code in app.py doesn't seem to work correctly. I worked around it by doing the following, but there's no comment indicating what this variable was supposed to be...
@@ -627,30 +627,38 @@ class Koan:
# fix URLs
if profile_data["autoinst"][0] == "/":
if not self.system:
- profile_data["autoinst"] = "http://%s/cblr/svc/op/ks/profile/%s" % (
+ profile_data["autoinst"] = "http://%s/cblr/svc/op/autoinstall/profile/%s" % (
profile_data['http_server'], profile_data['name'])
else:
- profile_data["autoinst"] = "http://%s/cblr/svc/op/ks/system/%s" % (
+ profile_data["autoinst"] = "http://%s/cblr/svc/op/autoinstall/system/%s" % (
profile_data['http_server'], profile_data['name'])
+ else:
+ if not self.system:
+ profile_data["autoinst"] = "http://%s/cblr/svc/op/autoinstall/profile/%s" % (
+ profile_data['http_server'], profile_data['name'])
+ else:
+ profile_data["autoinst"] = "http://%s/cblr/svc/op/autoinstall/system/%s" % (
+ profile_data['http_server'], profile_data['name'])
+
+
+ # 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", "suse"]:
+ self.get_install_tree_from_profile_data(profile_data)
+ else:
+ # find_autoinst source tree in the autoinst file
+ self.get_install_tree_from_autoinst(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", "suse"]:
- self.get_install_tree_from_profile_data(profile_data)
- else:
- # find_autoinst source tree in the autoinst file
- self.get_install_tree_from_autoinst(profile_data)
+ # if we found an install_tree, and we don't have a kernel or initrd
+ # use the ones in the install_tree
+ if self.safe_load(profile_data, "install_tree"):
+ if not self.safe_load(profile_data, "kernel"):
+ profile_data["kernel"] = profile_data[
+ "install_tree"] + "/images/pxeboot/vmlinuz"
- # if we found an install_tree, and we don't have a kernel or initrd
- # use the ones in the install_tree
- if self.safe_load(profile_data, "install_tree"):
- if not self.safe_load(profile_data, "kernel"):
- profile_data["kernel"] = profile_data[
- "install_tree"] + "/images/pxeboot/vmlinuz"
-
- if not self.safe_load(profile_data, "initrd"):
- profile_data["initrd"] = profile_data[
- "install_tree"] + "/images/pxeboot/initrd.img"
+ if not self.safe_load(profile_data, "initrd"):
+ profile_data["initrd"] = profile_data[
+ "install_tree"] + "/images/pxeboot/initrd.img"
# find the correct file download location
if not self.is_virt:
I assume profile_data is a Cobbler profile object converted to dict. "autoinst" is indeed a wrong attribute name, it should be "autoinstall" (see cobbler/item_profile.py)
Right, it seems like it... but "autoinstall" doesn't contain the right bits. e.g. on my server for a given profile that is "rhel7.ks". But given a non-fs like path in "autoinst", koan just calls self.get_install_tree_from_autoinst on profile_data, which does:
if profile_data["autoinst"][:4] == "http":
if not self.system:
url_fmt = "http://%s/cblr/svc/op/ks/profile/%s"
else:
url_fmt = "http://%s/cblr/svc/op/ks/system/%s"
url = url_fmt % (self.server, profile_data['name'])
else:
url = profile_data["autoinst"]
So it expects a URL it seems?