]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: don't fail hard on SameFileError during shutil.copy 42511/head
authorAdam King <adking@redhat.com>
Wed, 21 Jul 2021 18:42:44 +0000 (14:42 -0400)
committerAdam King <adking@redhat.com>
Tue, 27 Jul 2021 18:15:54 +0000 (14:15 -0400)
Fixes: https://tracker.ceph.com/issues/51829
Signed-off-by: Adam King <adking@redhat.com>
src/cephadm/cephadm

index 8b03505d3cba649eefb2b50e3e27ee864bbc45a6..266c90cec50d41785da970e1eced178e4a7bd33f 100755 (executable)
@@ -7430,8 +7430,11 @@ WantedBy=ceph-{fsid}.target
         # we pick up the file from where the orchestrator placed it - otherwise we'll
         # copy it to the binary location for this cluster
         if not __file__ == '<stdin>':
-            shutil.copy(__file__,
-                        self.binary_path)
+            try:
+                shutil.copy(__file__,
+                            self.binary_path)
+            except shutil.SameFileError:
+                pass
 
         with open(os.path.join(self.daemon_path, 'unit.run'), 'w') as f:
             f.write(self.unit_run)