only access match if we actually match fact

fixes #18601
pull/18606/head
Brian Coca 8 years ago
parent 778c983ef9
commit fbe5878919

@ -1600,7 +1600,9 @@ class SunOSHardware(Hardware):
"""
if out:
system_conf = out.split('\n')[0]
self.facts['product_name'] = re.search(r'(\w+\sEnterprise\s\w+)',system_conf).group(1)
found = re.search(r'(\w+\sEnterprise\s\w+)',system_conf)
if found:
self.facts['product_name'] = found.group(1)
class OpenBSDHardware(Hardware):
"""

Loading…
Cancel
Save