Hi,

Use the OS versions from codes.py in the freebsd importer (DRY).

-- 
Grtz,
Jörgen Maas
From d10a46d82bd9b0dff653a61ba8d3cac856c99ea0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=F6rgen=20Maas?= <jorgen.m...@gmail.com>
Date: Fri, 4 Nov 2011 18:46:09 +0100
Subject: [PATCH] cleanup: use codes.VALID_OS_VERSIONS in the freebsd importer

---
 cobbler/codes.py                         |    2 +-
 cobbler/modules/manage_import_freebsd.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cobbler/codes.py b/cobbler/codes.py
index 2b66b96..045ef3f 100644
--- a/cobbler/codes.py
+++ b/cobbler/codes.py
@@ -49,7 +49,7 @@ VALID_OS_VERSIONS = {
     "windows" : [ "winxp", "win2k", "win2k3", "vista", "other" ],
     "unix"    : [ "solaris9", "solaris10", "other" ],
     "vmware"  : [ "esx4", "esxi4" ],
-    "freebsd" : [ "freebsd7", "freebsd8" ],
+    "freebsd" : [ "7.3", "7.4", "8.1", "8.2", "9.0" ],
     "other"   : [ "msdos", "netware4", "netware5", "netware6", "generic", "other" ]
 }
 
diff --git a/cobbler/modules/manage_import_freebsd.py b/cobbler/modules/manage_import_freebsd.py
index 2ca54c4..81b03d9 100644
--- a/cobbler/modules/manage_import_freebsd.py
+++ b/cobbler/modules/manage_import_freebsd.py
@@ -33,7 +33,7 @@ import errno
 from utils import popen2
 from shlex import shlex
 
-
+import codes
 import utils
 from cexceptions import *
 import templar
@@ -162,7 +162,7 @@ class ImportFreeBSDManager:
 
     # required function for import modules
     def get_valid_os_versions(self):
-        return ["8.2",]
+        return codes.VALID_OS_VERSIONS["freebsd"]
 
     def get_valid_repo_breeds(self):
         return ["rsync", "rhn", "yum",]
-- 
1.7.1

_______________________________________________
cobbler-devel mailing list
cobbler-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/cobbler-devel

Reply via email to