From 994bc645a14be552257914e4c49a5ec7ec90fc30 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 7 Nov 2007 14:52:38 -0500 Subject: Make copyfile understand that if it can't copy a file to itself it shouldn't fail the operation. --- cobbler/action_sync.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cobbler/action_sync.py') diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index e6bce25..47586d1 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -960,8 +960,11 @@ class BootSync: def copyfile(self,src,dst): try: return shutil.copyfile(src,dst) - except IOError, ioe: - raise CX(_("Error copying %(src)s to %(dst)s") % { "src" : src, "dst" : 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}) def rmfile(self,path): try: -- cgit