summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts/library
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2015-10-22 16:48:24 -0400
committerAndrew Butcher <abutcher@redhat.com>2015-10-22 17:04:01 -0400
commit7eefcf8a04251da4d10deb936273847d47ccb609 (patch)
tree3a20ef7c6e3ae3efeef7b00982a61c7b3fe0d282 /roles/openshift_facts/library
parent5aff702d10b79822098ca68f9ee3184be45775d7 (diff)
downloadopenshift-7eefcf8a04251da4d10deb936273847d47ccb609.tar.gz
openshift-7eefcf8a04251da4d10deb936273847d47ccb609.tar.bz2
openshift-7eefcf8a04251da4d10deb936273847d47ccb609.tar.xz
openshift-7eefcf8a04251da4d10deb936273847d47ccb609.zip
Move version greater_than_fact into openshift_facts
Diffstat (limited to 'roles/openshift_facts/library')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 3570de693..d0388e6fe 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -20,6 +20,7 @@ EXAMPLES = '''
import ConfigParser
import copy
import os
+from ansible.runner.filter_plugins.core import version_compare
from distutils.util import strtobool
@@ -501,7 +502,12 @@ def set_deployment_facts_if_unset(facts):
if deployment_type in ['enterprise', 'online']:
data_dir = '/var/lib/openshift'
facts['common']['data_dir'] = data_dir
- facts['common']['version'] = get_openshift_version()
+ facts['common']['version'] = version = get_openshift_version()
+ if deployment_type == 'origin':
+ version_gt_3_1_or_1_1 = version_compare(version, '1.0.6', '>')
+ else:
+ version_gt_3_1_or_1_1 = version_compare(version, '3.0.2', '>')
+ facts['common']['version_greater_than_3_1_or_1_1'] = version_gt_3_1_or_1_1
for role in ('master', 'node'):
if role in facts:
@@ -632,7 +638,7 @@ def get_openshift_version():
Returns:
version: the current openshift version
"""
- version = ''
+ version = None
if os.path.isfile('/usr/bin/openshift'):
_, output, _ = module.run_command(['/usr/bin/openshift', 'version'])