summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-04-14 11:07:24 -0400
committerMichael DeHaan <mdehaan@redhat.com>2008-04-14 11:07:24 -0400
commit6f6c1c700aac364d5cb2f29d039c950f26767f10 (patch)
tree52c2649be8bfaf736217ceea06522a9439f527f8
parent650fcae97e686108592cff603ad6e95c5dc43c7d (diff)
downloadthird_party-cobbler-6f6c1c700aac364d5cb2f29d039c950f26767f10.tar.gz
third_party-cobbler-6f6c1c700aac364d5cb2f29d039c950f26767f10.tar.xz
third_party-cobbler-6f6c1c700aac364d5cb2f29d039c950f26767f10.zip
F8/9 kickstart format support
-rw-r--r--CHANGELOG1
-rw-r--r--cobbler/action_import.py9
-rw-r--r--cobbler/utils.py10
-rw-r--r--setup.py1
4 files changed, 12 insertions, 9 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b6d6d14..5e1e8ca 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,7 @@ Cobbler CHANGELOG
- removed dependency on rhpl
- import can now take an --arch (and is recommended usage)
- now possible to override snippets on a profile/system specific basis
+- provide a different default sample kickstart for imports of F8 and later
- ??? - 0.8.3
- Make createrepo get run for local cobbler reposync invocations as needed
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index 7f5409b..377b122 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -192,13 +192,6 @@ class Importer:
print _("- skipping distro %s since it wasn't imported this time") % profile.distro
continue
- # THIS IS OBSOLETE:
- #
- #if not distro.kernel.startswith("%s/ks_mirror/" % self.settings.webdir):
- # # this isn't a mirrored profile, so we won't touch it
- # print _("- skipping %s since profile isn't mirrored") % profile.name
- # continue
-
if (self.kickstart_file == None):
kdir = os.path.dirname(distro.kernel)
base_dir = "/".join(kdir.split("/")[0:-2])
@@ -287,6 +280,8 @@ class Importer:
def set_kickstart(self, profile, flavor, major, minor):
if flavor == "fedora":
+ if major >= 8:
+ return profile.set_kickstart("/etc/cobbler/sample_end.ks")
if major >= 6:
return profile.set_kickstart("/etc/cobbler/sample.ks")
if flavor == "redhat" or flavor == "centos":
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 2d601c7..8cc75bb 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -480,13 +480,19 @@ def fix_mod_python_select_submission(repos):
repos = repos.replace('"',"")
repos = repos.lstrip().rstrip()
return repos
+
def check_dist():
+ """
+ Determines what distro we're running under.
+ """
if os.path.exists("/etc/debian_version"):
return "debian"
else:
+ # valid for Fedora and all Red Hat / Fedora derivatives
return "redhat"
-def redhat_release():
+def os_release():
+
if check_dist() == "redhat":
if not os.path.exists("/bin/rpm"):
@@ -536,7 +542,7 @@ def tftpboot_location():
return t
# otherwise, guess based on the distro
- (make,version,rest) = redhat_release()
+ (make,version,rest) = os_release()
if make == "fedora" and version >= 9:
return "/var/lib/tftpboot"
return "/tftpboot"
diff --git a/setup.py b/setup.py
index 51ffe80..31ead00 100644
--- a/setup.py
+++ b/setup.py
@@ -88,6 +88,7 @@ if __name__ == "__main__":
# sample kickstart files
(etcpath, ['kickstarts/legacy.ks']),
(etcpath, ['kickstarts/sample.ks']),
+ (etcpath, ['kickstarts/sample_end.ks']),
(etcpath, ['kickstarts/default.ks']),
# templates for DHCP and syslinux configs