From 76bcb9d0e21545a8f881a12cb52f5facef4feb82 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Sun, 6 Mar 2016 09:12:45 -0500 Subject: [PATCH] avoid basename on none --- lib/ansible/module_utils/facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 87dbf53d71e..28ae5034e07 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -562,7 +562,7 @@ class Facts(object): # also other OSs other than linux might need to check across several possible candidates # try various forms of querying pid 1 - proc_1 = os.path.basename(get_file_content('/proc/1/comm')) + proc_1 = get_file_content('/proc/1/comm') if proc_1 is None: rc, proc_1, err = module.run_command("ps -p 1 -o comm|tail -n 1", use_unsafe_shell=True) else: