diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-10-16 14:26:31 -0400 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-10-16 14:26:31 -0400 |
commit | 3819a6a8a1afc48be0b745a488b28a45018ac53b (patch) | |
tree | 8301ecfcf9e923fae77e042f6a919dc2bef06410 | |
parent | 0e367742e560e50a2d413001723ce27acff44b7b (diff) | |
download | third_party-cobbler-3819a6a8a1afc48be0b745a488b28a45018ac53b.tar.gz third_party-cobbler-3819a6a8a1afc48be0b745a488b28a45018ac53b.tar.xz third_party-cobbler-3819a6a8a1afc48be0b745a488b28a45018ac53b.zip |
It's simpler if imported distros and profiles are named after the path without mmodification, so we won't transmogrify them.
-rw-r--r-- | cobbler/action_import.py | 13 | ||||
-rw-r--r-- | tests/tests.py | 10 |
2 files changed, 12 insertions, 11 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py index 8c19ccd..90dd30c 100644 --- a/cobbler/action_import.py +++ b/cobbler/action_import.py @@ -78,7 +78,9 @@ class Importer: update_file = os.path.open(os.path.join(self.path,"update.sh")) update_file.write("#!/bin/sh") update_file.write("%s\n" % cmd) - update_file.write("cobbler import --path=%s" % self.path) + # leave this commented out in the file because it will + # erase user customizations. + update_file.write("#cobbler import --path=%s" % self.path) update_file.close() if self.path is not None: arg = None @@ -200,11 +202,10 @@ class Importer: print "*** PROFILE ADDED ***" def get_proposed_name(self,dirname): - # FIXME: how can this name be nicer? - temp = "_".join(dirname.split("/")) - if temp.startswith("_"): - temp = temp[1:] - return temp + # for now, just use the path to the images directory as the + # name or the profile. This provides the added bonus of letting + # the shell interpolate it. + return dirname def get_pxe_arch(self,dirname): t = dirname diff --git a/tests/tests.py b/tests/tests.py index 4911303..243934b 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -307,11 +307,11 @@ class TestImport(BootTest): # below: # partial name of distro: current count, passing count, required arch haystacks = { - "import_testdata_RHEL-4_U4_AS_ia64_tree_images_pxeboot" : [0, 1, "ia64" ], - "import_testdata_RHEL-4_U4_AS_i386_tree_images_pxeboot" : [0, 1, "x86" ], - "import_testdata_RHEL-4_U4_AS_x86_64_tree_images_pxeboot" : [0, 1, "x86_64" ], - "import_testdata_core_5_i386_os_images_pxeboot" : [ 0, 1, "x86" ], - "import_testdata_core_5_i386_os_images_xen" : [0, 1, "x86" ], + "import_testdata/RHEL-4/U4/AS/ia64/tree/images/pxeboot" : [0, 1, "ia64" ], + "import_testdata/RHEL-4/U4/AS/i386/tree/images/pxeboot" : [0, 1, "x86" ], + "import_testdata/RHEL-4/U4/AS/x86_64/tree/images/pxeboot" : [0, 1, "x86_64" ], + "import_testdata/core/5/i386/os/images/pxeboot" : [ 0, 1, "x86" ], + "import_testdata/core/5/i386/os/images/xen" : [0, 1, "x86" ], } # first go through all found distros and count the matches |