File koan-virt-setup-suse.dif of Package cobbler.8146

Index: cobbler-2.6.6/koan/app.py
===================================================================
--- cobbler-2.6.6.orig/koan/app.py
+++ cobbler-2.6.6/koan/app.py
@@ -766,7 +766,14 @@ class Koan:
             else:
                 print "warning: kickstart found but no install_tree found"
         except:
-            pass
+            if profile_data["breed"] == "suse":
+                options = profile_data["kernel_options"].split(" ")
+                for opt in options:
+                    if opt.startswith("install="):
+                        profile_data["install_tree"] = opt.replace("install=","")
+                        break
+            else:
+                pass
 
     #---------------------------------------------------
 
Index: cobbler-2.6.6/koan/utils.py
===================================================================
--- cobbler-2.6.6.orig/koan/utils.py
+++ cobbler-2.6.6/koan/utils.py
@@ -173,23 +173,24 @@ def subprocess_call(cmd,ignore_rc=0):
         raise InfoException, "command failed (%s)" % rc
     return rc
 
-def subprocess_get_response(cmd, ignore_rc=False):
+def subprocess_get_response(cmd, ignore_rc=False, get_stderr=False):
     """
     Wrapper around subprocess.check_output(...)
     """
     print "- %s" % cmd
     rc = 0
     result = ""
-    if not ANCIENT_PYTHON:
-        p = sub_process.Popen(cmd, stdout=sub_process.PIPE)
-        result = p.communicate()[0]
-        rc = p.wait()
+    if get_stderr:
+        p = sub_process.Popen(cmd, stdout=sub_process.PIPE, stderr=sub_process.PIPE)
     else:
-        cmd = string.join(cmd, " ")
-        print "cmdstr=(%s)" % cmd
-        rc = os.system(cmd)
+        p = sub_process.Popen(cmd, stdout=sub_process.PIPE)
+
+    result, stderr_result = p.communicate()
+    rc = p.wait()
     if not ignore_rc and rc != 0:
         raise InfoException, "command failed (%s)" % rc
+    if get_stderr:
+        return rc, result, stderr_result
     return rc, result
 
 def input_string_or_hash(options,delim=None,allow_multiples=True):
Index: cobbler-2.6.6/koan/virtinstall.py
===================================================================
--- cobbler-2.6.6.orig/koan/virtinstall.py
+++ cobbler-2.6.6/koan/virtinstall.py
@@ -38,10 +38,13 @@ import utils
 # command line tool. This should work on both old and new variants,
 # as the virt-install command line tool has always been provided by
 # python-virtinst (and now the new virt-install rpm).
-rc, response = utils.subprocess_get_response(
-        shlex.split('virt-install --version'), True)
+rc, response, stderr_response = utils.subprocess_get_response(
+        shlex.split('virt-install --version'), True, True)
 if rc == 0:
-    virtinst_version = response
+    if response:
+        virtinst_version = response
+    else:
+        virtinst_version = stderr_response
 else:
     virtinst_version = None