diff options
author | Diego Castro <spinolacastro@gmail.com> | 2015-08-27 13:41:16 -0300 |
---|---|---|
committer | Diego Castro <spinolacastro@gmail.com> | 2015-08-27 13:41:16 -0300 |
commit | d54665d0c0c1f7a3cec572c04f3ce769277c05e4 (patch) | |
tree | 043628b7a804ad66019129129cc0186289d80a28 /roles/openshift_facts | |
parent | 055921cd545c12733949f37c1af2c0a1296216ec (diff) | |
parent | 5c7e1366ad8ae67ef23117d296a65a6ee81ccd29 (diff) | |
download | openshift-d54665d0c0c1f7a3cec572c04f3ce769277c05e4.tar.gz openshift-d54665d0c0c1f7a3cec572c04f3ce769277c05e4.tar.bz2 openshift-d54665d0c0c1f7a3cec572c04f3ce769277c05e4.tar.xz openshift-d54665d0c0c1f7a3cec572c04f3ce769277c05e4.zip |
Merge remote-tracking branch 'openshift/master'
Diffstat (limited to 'roles/openshift_facts')
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 4e0989c5f..c1c4e1b5c 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -323,6 +323,24 @@ def set_fluentd_facts_if_unset(facts): facts['common']['use_fluentd'] = use_fluentd return facts +def set_cluster_metrics_facts_if_unset(facts): + """ Set cluster metrics facts if not already present in facts dict + dict: the facts dict updated with the generated cluster metrics facts if + missing + Args: + facts (dict): existing facts + Returns: + dict: the facts dict updated with the generated cluster metrics + facts if they were not already present + + """ + if 'common' in facts: + deployment_type = facts['common']['deployment_type'] + if 'use_cluster_metrics' not in facts['common']: + use_cluster_metrics = True if deployment_type == 'origin' else False + facts['common']['use_cluster_metrics'] = use_cluster_metrics + return facts + def set_identity_providers_if_unset(facts): """ Set identity_providers fact if not already present in facts dict @@ -700,6 +718,7 @@ class OpenShiftFacts(object): facts['current_config'] = get_current_config(facts) facts = set_url_facts_if_unset(facts) facts = set_fluentd_facts_if_unset(facts) + facts = set_cluster_metrics_facts_if_unset(facts) facts = set_identity_providers_if_unset(facts) facts = set_registry_url_if_unset(facts) facts = set_sdn_facts_if_unset(facts) |