From fe3ed63a6f7103a91888df3807121ac6b43cde7c Mon Sep 17 00:00:00 2001 From: Samuel Munilla Date: Fri, 2 Oct 2015 08:54:09 -0400 Subject: openshift_facts.py: Correct error case for uninstalled systems This adds a default value to the version to cover the case where the user doesn't have /usr/bin/openshift on the system, correcting the bug found in PR #646. --- roles/openshift_facts/library/openshift_facts.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'roles') diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index aeab7152c..987f7f7da 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -605,6 +605,8 @@ def get_openshift_version(): Returns: version: the current openshift version """ + version = '' + if os.path.isfile('/usr/bin/openshift'): _, output, _ = module.run_command(['/usr/bin/openshift', 'version']) versions = dict(e.split(' v') for e in output.splitlines()) -- cgit v1.2.3