File koan_S_support_suse_breed_2.patch of Package cobbler

From 9bb1a6107a22145085f8b4796a4a5c198a55712d Mon Sep 17 00:00:00 2001
From: Oliver Gorwits <oliver@cpan.org>
Date: Wed, 18 Jul 2012 18:07:31 +0200
Subject: [PATCH 2/2] Allow koan's -S option to work for SuSE breed. Also
 remove -S for breed=None, as I assume "Red Hat" is not a sane assumption for
 all Distros without a breed.

---
 koan/app.py | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Index: cobbler-2.2.2/koan/app.py
===================================================================
--- cobbler-2.2.2.orig/koan/app.py
+++ cobbler-2.2.2/koan/app.py
@@ -1219,7 +1219,7 @@ class Koan:
 
         hashv = utils.input_string_or_hash(kextra)
 
-        if self.static_interface is not None and (breed is None or breed == "redhat"):
+        if self.static_interface is not None and (breed == "redhat" or breed == "suse"):
             interface_name = self.static_interface
             interfaces = self.safe_load(pd, "interfaces")
             if interface_name.startswith("eth"):
@@ -1233,15 +1233,24 @@ class Koan:
             gateway = self.safe_load(pd, "gateway")
             dns = self.safe_load(pd, "name_servers")
 
-            hashv["ksdevice"] = self.static_interface
+            if breed == "suse":
+                hashv["netdevice"] = self.static_interface
+            else:
+                hashv["ksdevice"] = self.static_interface
             if ip is not None:
-                hashv["ip"] = ip
+                if breed == "suse":
+                    hashv["hostip"] = ip
+                else:
+                    hashv["ip"] = ip
             if netmask is not None:
                 hashv["netmask"] = netmask
             if gateway is not None:
                 hashv["gateway"] = gateway
             if dns is not None:
-                hashv["dns"] = ",".join(dns)
+                if breed == "suse":
+                    hashv["nameserver"] = dns[0]
+                else:
+                    hashv["dns"] = ",".join(dns)
 
         if replace_self and self.embed_kickstart:
            hashv["ks"] = "file:ks.cfg"
openSUSE Build Service is sponsored by