summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorSamuel Munilla <smunilla@redhat.com>2015-10-02 08:54:09 -0400
committerSamuel Munilla <smunilla@redhat.com>2015-10-02 09:14:00 -0400
commitfe3ed63a6f7103a91888df3807121ac6b43cde7c (patch)
tree1d558fccba625213c2727c1ee807cdc078f86db1 /roles
parent82cf8189c7ea1709890926f64f0b4875b552dfc2 (diff)
downloadopenshift-fe3ed63a6f7103a91888df3807121ac6b43cde7c.tar.gz
openshift-fe3ed63a6f7103a91888df3807121ac6b43cde7c.tar.bz2
openshift-fe3ed63a6f7103a91888df3807121ac6b43cde7c.tar.xz
openshift-fe3ed63a6f7103a91888df3807121ac6b43cde7c.zip
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.
Diffstat (limited to 'roles')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py2
1 files changed, 2 insertions, 0 deletions
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())