Odd... git-send-email did not send that correctly at all.  Here is the
correct patch:

---
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index e4c0836..bf8328c 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -642,6 +642,28 @@ class Importer:
                profile.set_virt_type("qemu")

            self.profiles.add(profile,save=True)
+
+           # Create a rescue image as well,
+           # assuming this isn't a xen distro
+           if name.find("-xen") == -1:
+               rescue_name = 'rescue-' + name
+               existing_profile = self.profiles.find(name=rescue_name)
+
+               if existing_profile is None:
+                   print _("- creating new profile: %s") % rescue_name
+                   profile = self.config.new_profile()
+               else:
+                   print _("- modifying existing profile: %s") %
rescue_name
+                   profile = existing_profile
+
+               profile.set_name(rescue_name)
+               profile.set_distro(name)
+               profile.set_virt_type("qemu")
+               profile.kernel_options['rescue'] = None
+               profile.kickstart = '/etc/cobbler/pxerescue.ks'
+
+               self.profiles.add(profile,save=True)
+
            self.api.serialize()

    def get_proposed_name(self,dirname,pxe_arch):
diff --git a/kickstarts/pxerescue.ks b/kickstarts/pxerescue.ks
new file mode 100644
index 0000000..c84962e
--- /dev/null
+++ b/kickstarts/pxerescue.ks
@@ -0,0 +1,15 @@
+# Rescue Boot Template
+
+# Set the language and language support
+lang en_US
+langsupport en_US
+
+# Set the keyboard
+keyboard "us"
+
+# Network kickstart
+network --bootproto dhcp
+
+# Rescue method (only NFS/FTP/HTTP currently supported)
+url --url=$tree
+


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to