From: Adam King Date: Wed, 21 Jul 2021 18:42:44 +0000 (-0400) Subject: cephadm: don't fail hard on SameFileError during shutil.copy X-Git-Tag: v17.1.0~1269^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3909be178addb6f692d97651bfdaf9ae742497f1;p=ceph.git cephadm: don't fail hard on SameFileError during shutil.copy Fixes: https://tracker.ceph.com/issues/51829 Signed-off-by: Adam King --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 8b03505d3cba6..266c90cec50d4 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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__ == '': - 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)