From 3909be178addb6f692d97651bfdaf9ae742497f1 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 21 Jul 2021 14:42:44 -0400 Subject: [PATCH] cephadm: don't fail hard on SameFileError during shutil.copy Fixes: https://tracker.ceph.com/issues/51829 Signed-off-by: Adam King --- src/cephadm/cephadm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.39.5