diff options
| author | Wesley Hearn <wesley.s.hearn@gmail.com> | 2015-09-04 11:44:11 -0400 | 
|---|---|---|
| committer | Wesley Hearn <wesley.s.hearn@gmail.com> | 2015-09-04 11:44:11 -0400 | 
| commit | 0588094f46cfeb0eb15d2a601561bc6213a2f87f (patch) | |
| tree | 004910afa4bf83cb6214404cad5c28ee2cfb7d68 | |
| parent | 08c35fee232fefd05b0e713fe3d10fdcd03b7d83 (diff) | |
| parent | b5dd6fbc6070d7bbf985b43abe7d3f8e66b74fa3 (diff) | |
Merge pull request #555 from umairmufti/issue-554
Fix to ensure use_openshift_sdn is a boolean value.
| -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 | 
