summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2017-01-13 14:03:22 -0500
committerBrian Coca <brian.coca+git@gmail.com>2017-01-13 14:06:11 -0500
commit4b495d7e43360fc5f45dc84dbd2f6034c4148d21 (patch)
treee2dbcf0cbc8f9fb73ab06991eb0eaf96908eb2de
parentc846e915f8e14f0f0f365aa225d98eca7f27e821 (diff)
downloadansible-4b495d7e43360fc5f45dc84dbd2f6034c4148d21.tar.gz
fix issue when proc read returns None
fixes #20225
-rw-r--r--lib/ansible/module_utils/facts.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index 9ca8fed850..3e7078f595 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -336,7 +336,7 @@ class Facts(object):
proc_1 = to_native(proc_1)
proc_1 = proc_1.strip()
- if proc_1 == 'init' or proc_1.endswith('sh'):
+ if proc_1 is not None and (proc_1 == 'init' or proc_1.endswith('sh')):
# many systems return init, so this cannot be trusted, if it ends in 'sh' it probalby is a shell in a container
proc_1 = None