diff options
author | Steve Milner <smilner@redhat.com> | 2017-09-28 14:04:03 -0400 |
---|---|---|
committer | Steve Milner <smilner@redhat.com> | 2017-09-28 14:04:03 -0400 |
commit | 95489f6f04dafb3051b44b420a22b4252bcdd4dd (patch) | |
tree | 22c028f552cfee445022fdf666bd6aa792c7410f | |
parent | e3d5519c6d68b9aa162a58e1a897b6e4f6b0eea1 (diff) | |
download | openshift-95489f6f04dafb3051b44b420a22b4252bcdd4dd.tar.gz openshift-95489f6f04dafb3051b44b420a22b4252bcdd4dd.tar.bz2 openshift-95489f6f04dafb3051b44b420a22b4252bcdd4dd.tar.xz openshift-95489f6f04dafb3051b44b420a22b4252bcdd4dd.zip |
openshift_facts: coerce docker_use_system_container to bool
Use safe_get_bool() when reading docker_use_system_container to ensure
that ansible accepted inputs are turned into real boolean results.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1496725
Signed-off-by: Steve Milner <smilner@redhat.com>
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 1c2c91a5a..fa390766e 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -1680,7 +1680,9 @@ def set_container_facts_if_unset(facts): facts['common']['is_atomic'] = os.path.isfile('/run/ostree-booted') # If openshift_docker_use_system_container is set and is True .... if 'use_system_container' in list(facts['docker'].keys()): - if facts['docker']['use_system_container']: + # use safe_get_bool as the inventory variable may not be a + # valid boolean on it's own. + if safe_get_bool(facts['docker']['use_system_container']): # ... set the service name to container-engine facts['docker']['service_name'] = 'container-engine' |