From 95489f6f04dafb3051b44b420a22b4252bcdd4dd Mon Sep 17 00:00:00 2001 From: Steve Milner Date: Thu, 28 Sep 2017 14:04:03 -0400 Subject: 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 --- roles/openshift_facts/library/openshift_facts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'roles') 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' -- cgit v1.2.3