summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts/library
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-01-06 16:47:52 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2016-01-06 16:47:52 -0500
commita2fb89156aac2cecdd4b683412d373e747a333a2 (patch)
treeb18440e78ec337afebad56a9891a5e4882815f4a /roles/openshift_facts/library
parent02de437221381a0d209c903bb1851ea58e605480 (diff)
parent220982cf741faebccfb066e822626c7a951735c3 (diff)
downloadopenshift-a2fb89156aac2cecdd4b683412d373e747a333a2.tar.gz
openshift-a2fb89156aac2cecdd4b683412d373e747a333a2.tar.bz2
openshift-a2fb89156aac2cecdd4b683412d373e747a333a2.tar.xz
openshift-a2fb89156aac2cecdd4b683412d373e747a333a2.zip
Merge pull request #1123 from brenton/manageiq
We can't enable manageiq for installations less than OSE 3.1 or Origiā€¦
Diffstat (limited to 'roles/openshift_facts/library')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index b2acd789d..0b57439e7 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -715,6 +715,26 @@ def set_version_facts_if_unset(facts):
return facts
+def set_manageiq_facts_if_unset(facts):
+ """ Set manageiq facts. This currently includes common.use_manageiq.
+
+ Args:
+ facts (dict): existing facts
+ Returns:
+ dict: the facts dict updated with version facts.
+ Raises:
+ OpenShiftFactsInternalError:
+ """
+ if 'common' not in facts:
+ if 'version_greater_than_3_1_or_1_1' not in facts['common']:
+ raise OpenShiftFactsInternalError(
+ "Invalid invocation: The required facts are not set"
+ )
+
+ facts['common']['use_manageiq'] = facts['common']['version_greater_than_3_1_or_1_1']
+
+ return facts
+
def set_sdn_facts_if_unset(facts, system_facts):
""" Set sdn facts if not already present in facts dict
@@ -1021,6 +1041,11 @@ def set_container_facts_if_unset(facts):
return facts
+class OpenShiftFactsInternalError(Exception):
+ """Origin Facts Error"""
+ pass
+
+
class OpenShiftFactsUnsupportedRoleError(Exception):
"""Origin Facts Unsupported Role Error"""
pass
@@ -1097,6 +1122,7 @@ class OpenShiftFacts(object):
facts = set_sdn_facts_if_unset(facts, self.system_facts)
facts = set_deployment_facts_if_unset(facts)
facts = set_version_facts_if_unset(facts)
+ facts = set_manageiq_facts_if_unset(facts)
facts = set_aggregate_facts(facts)
facts = set_etcd_facts_if_unset(facts)
facts = set_container_facts_if_unset(facts)
@@ -1122,7 +1148,7 @@ class OpenShiftFacts(object):
common = dict(use_openshift_sdn=True, ip=ip_addr, public_ip=ip_addr,
deployment_type='origin', hostname=hostname,
- public_hostname=hostname, use_manageiq=True)
+ public_hostname=hostname)
common['client_binary'] = 'oc'
common['admin_binary'] = 'oadm'
common['dns_domain'] = 'cluster.local'