summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenShift Bot <eparis+openshiftbot@redhat.com>2017-08-16 19:31:07 -0400
committerGitHub <noreply@github.com>2017-08-16 19:31:07 -0400
commita61da58f73c9cc3b3d4bff284752d9385f15fc32 (patch)
treec1b9b6dee5eb242ae86e8ee5a2759ded927b89c1
parentaca1e3a02867b7994b4f192cff06ebbdbce80a87 (diff)
parentcba2765d6af705f66a806c55640ea3fd8a7e34f8 (diff)
downloadopenshift-a61da58f73c9cc3b3d4bff284752d9385f15fc32.tar.gz
openshift-a61da58f73c9cc3b3d4bff284752d9385f15fc32.tar.bz2
openshift-a61da58f73c9cc3b3d4bff284752d9385f15fc32.tar.xz
openshift-a61da58f73c9cc3b3d4bff284752d9385f15fc32.zip
Merge pull request #5098 from ashcrow/bin-sync-link-check
Merged by openshift-bot
-rw-r--r--roles/openshift_cli/library/openshift_container_binary_sync.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/roles/openshift_cli/library/openshift_container_binary_sync.py b/roles/openshift_cli/library/openshift_container_binary_sync.py
index c47203211..b40c49701 100644
--- a/roles/openshift_cli/library/openshift_container_binary_sync.py
+++ b/roles/openshift_cli/library/openshift_container_binary_sync.py
@@ -133,6 +133,11 @@ class BinarySyncer(object):
dest_path = os.path.join(self.bin_dir, binary_name)
incoming_checksum = self.module.run_command(['sha256sum', src_path])[1]
if not os.path.exists(dest_path) or self.module.run_command(['sha256sum', dest_path])[1] != incoming_checksum:
+
+ # See: https://github.com/openshift/openshift-ansible/issues/4965
+ if os.path.islink(dest_path):
+ os.unlink(dest_path)
+ self.output.append('Removed old symlink {} before copying binary.'.format(dest_path))
shutil.move(src_path, dest_path)
self.output.append("Moved %s to %s." % (src_path, dest_path))
self.changed = True