From 2b9b3a08a1669887063157b33b27a4cf9e0f5016 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 5 Aug 2015 09:43:55 -0400 Subject: [PATCH] make sure you only update pci data if there is a match --- lib/ansible/module_utils/facts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index a3f8c05d651..f7e8d7fb9e5 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -1048,7 +1048,8 @@ class LinuxHardware(Hardware): pciid = m.group(1) did = re.escape(pciid) m = re.search("^" + did + "\s(.*)$", pcidata, re.MULTILINE) - d['host'] = m.group(1) + if m: + d['host'] = m.group(1) d['holders'] = [] if os.path.isdir(sysdir + "/holders"):