diff options
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | cobbler/commands.py | 11 | ||||
-rw-r--r-- | cobbler/utils.py | 11 |
3 files changed, 14 insertions, 9 deletions
@@ -4,6 +4,7 @@ Cobbler CHANGELOG - Mon May 12 2008 - 0.9.2 - run createrepo with less preconditions during cobbler reposync - doc upgrades and error handling for "cobbler replicate" +- improved error message that occurs when copying from nfs w/ rootsquash - Fri May 09 2008 - 0.9.1 - patch to allow yumopts to override gpgcheck diff --git a/cobbler/commands.py b/cobbler/commands.py index 657934c..705249d 100644 --- a/cobbler/commands.py +++ b/cobbler/commands.py @@ -295,11 +295,12 @@ class CobblerFunction: else: rc = collect_fn().add(obj, save=True, with_sync=opt_sync, with_triggers=opt_triggers, check_for_duplicate_names=False, check_for_duplicate_netinfo=False) else: - # editing or copying (but not renaming), so duplicate netinfo - # CAN be bad, duplicate names are already handled, though - # we need to clean up checks around duplicate netinfo here - # (FIXME) so they are made and work. - rc = collect_fn().add(obj, save=True, with_sync=opt_sync, with_triggers=opt_triggers) + check_dup = False + if not "copy" in self.args: + check_dup = True + # FIXME: this ensures duplicate prevention on copy, but not + # rename? + rc = collect_fn().add(obj, save=True, with_sync=opt_sync, with_triggers=opt_triggers, check_for_duplicate_netinfo=check_dup) else: # we are renaming here, so duplicate netinfo checks also diff --git a/cobbler/utils.py b/cobbler/utils.py index 1b4b30a..a9b374f 100644 --- a/cobbler/utils.py +++ b/cobbler/utils.py @@ -590,10 +590,13 @@ def copyfile(src,dst): try: return shutil.copyfile(src,dst) except: - if not os.path.samefile(src,dst): - # accomodate for the possibility that we already copied - # the file as a symlink/hardlink - raise CX(_("Error copying %(src)s to %(dst)s") % { "src" : src, "dst" : dst}) + try: + if not os.path.samefile(src,dst): + # accomodate for the possibility that we already copied + # the file as a symlink/hardlink + raise CX(_("Error copying %(src)s to %(dst)s") % { "src" : src, "dst" : dst}) + except: + raise CX(_("Problems reading %(src)s") % { "src" : src}) def rmfile(path): try: |