diff options
author | Umair Mufti <umair@sparcq.com> | 2015-09-03 11:28:46 -0700 |
---|---|---|
committer | Umair Mufti <umair@sparcq.com> | 2015-09-03 11:28:46 -0700 |
commit | b5dd6fbc6070d7bbf985b43abe7d3f8e66b74fa3 (patch) | |
tree | 9b53c9e047a4dcab467cb7e156c1252bce440c9a /roles/openshift_facts | |
parent | f25e1d9954b6c614b7890fe5f0b60fb83b165f65 (diff) | |
download | openshift-b5dd6fbc6070d7bbf985b43abe7d3f8e66b74fa3.tar.gz openshift-b5dd6fbc6070d7bbf985b43abe7d3f8e66b74fa3.tar.bz2 openshift-b5dd6fbc6070d7bbf985b43abe7d3f8e66b74fa3.tar.xz openshift-b5dd6fbc6070d7bbf985b43abe7d3f8e66b74fa3.zip |
Fix to ensure use_openshift_sdn is a boolean value.
Diffstat (limited to 'roles/openshift_facts')
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 23c74f61c..679c3273a 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -16,6 +16,7 @@ EXAMPLES = ''' import ConfigParser import copy import os +from distutils.util import strtobool def hostname_valid(hostname): @@ -494,8 +495,10 @@ def set_sdn_facts_if_unset(facts): were not already present """ if 'common' in facts: + use_sdn = facts['common']['use_openshift_sdn'] + if not (use_sdn == '' or isinstance(use_sdn, bool)): + facts['common']['use_openshift_sdn'] = bool(strtobool(str(use_sdn))) if 'sdn_network_plugin_name' not in facts['common']: - use_sdn = facts['common']['use_openshift_sdn'] plugin = 'redhat/openshift-ovs-subnet' if use_sdn else '' facts['common']['sdn_network_plugin_name'] = plugin |