File support-cobbler-2.X-kickstart-profile-data.diff of Package koan.13374

From d94f67fd327af7ec159eb2f86786c95e3492a140 Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@nwra.com>
Date: Thu, 17 Oct 2019 16:20:06 -0600
Subject: [PATCH] Support cobbler 2.X "kickstart" profile data

---
 koan/app.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/koan/app.py b/koan/app.py
index db30481..4823f74 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -621,8 +621,12 @@ class Koan:
             # shouldn't end up here, right?
             profile_data = {}
 
-        if profile_data.get("autoinst", "") != "":
+        if profile_data.get("autoinst", "") == "":
+            # Fall back to kickstart from cobbler < 3.X
+            if profile_data.get("kickstart", "") != "":
+                profile_data["autoinst"] = profile_data["kickstart"]
 
+        if "autoinst" in profile_data:
             # fix URLs
             if profile_data["autoinst"][0] == "/":
                 if not self.system:
-- 
2.23.0

openSUSE Build Service is sponsored by