diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-04-14 11:07:24 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-04-14 11:07:24 -0400 |
commit | 6f6c1c700aac364d5cb2f29d039c950f26767f10 (patch) | |
tree | 52c2649be8bfaf736217ceea06522a9439f527f8 | |
parent | 650fcae97e686108592cff603ad6e95c5dc43c7d (diff) | |
download | third_party-cobbler-6f6c1c700aac364d5cb2f29d039c950f26767f10.tar.gz third_party-cobbler-6f6c1c700aac364d5cb2f29d039c950f26767f10.tar.xz third_party-cobbler-6f6c1c700aac364d5cb2f29d039c950f26767f10.zip |
F8/9 kickstart format support
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | cobbler/action_import.py | 9 | ||||
-rw-r--r-- | cobbler/utils.py | 10 | ||||
-rw-r--r-- | setup.py | 1 |
4 files changed, 12 insertions, 9 deletions
@@ -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" @@ -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 |