]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: don't fail hard on SameFileError during shutil.copy
authorAdam King <adking@redhat.com>
Wed, 21 Jul 2021 18:42:44 +0000 (14:42 -0400)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 14:32:15 +0000 (16:32 +0200)
Fixes: https://tracker.ceph.com/issues/51829
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 3909be178addb6f692d97651bfdaf9ae742497f1)

src/cephadm/cephadm

index 90fa552eb6c2920ce898cd94ffff5e277997f4e8..d9fac4a05baf627c4dfde71880279f913798237b 100755 (executable)
@@ -7404,8 +7404,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)