Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the "autoinst" variable in profile_data supposed to be? #10

Open
nacc opened this issue May 15, 2015 · 2 comments
Open

What is the "autoinst" variable in profile_data supposed to be? #10

nacc opened this issue May 15, 2015 · 2 comments
Labels

Comments

@nacc
Copy link

nacc commented May 15, 2015

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:
@alanoe
Copy link

alanoe commented May 15, 2015

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)

@nacc
Copy link
Author

nacc commented May 15, 2015

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants