From 3ea0166aa301990d4f95fdb1c48557e710aa0b05 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 18 Oct 2016 09:39:21 -0300 Subject: Switch from "oadm" to "oc adm" and fix bug in binary sync. Found bug syncing binaries to containerized hosts where if a symlink was pre-existing, but pointing to the wrong destination, it would not be corrected. Switched to using oc adm instead of oadm. --- roles/openshift_cli/library/openshift_container_binary_sync.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'roles/openshift_cli') diff --git a/roles/openshift_cli/library/openshift_container_binary_sync.py b/roles/openshift_cli/library/openshift_container_binary_sync.py index fd290c6fc..9ff738d14 100644 --- a/roles/openshift_cli/library/openshift_container_binary_sync.py +++ b/roles/openshift_cli/library/openshift_container_binary_sync.py @@ -83,8 +83,13 @@ class BinarySyncer(object): def _sync_symlink(self, binary_name, link_to): """ Ensure the given binary name exists and links to the expected binary. """ + + # The symlink we are creating: link_path = os.path.join(self.bin_dir, binary_name) - link_dest = os.path.join(self.bin_dir, binary_name) + + # The expected file we should be linking to: + link_dest = os.path.join(self.bin_dir, link_to) + if not os.path.exists(link_path) or \ not os.path.islink(link_path) or \ os.path.realpath(link_path) != os.path.realpath(link_dest): -- cgit v1.2.1