Fixed setup module to no longer break on OpenBSD release versions.

reviewable/pr18780/r1
Johan Wirén 11 years ago
parent 6eec6f776e
commit 9120303446

@ -273,9 +273,9 @@ class Facts(object):
self.facts['distribution'] = 'OpenBSD' self.facts['distribution'] = 'OpenBSD'
self.facts['distribution_release'] = platform.release() self.facts['distribution_release'] = platform.release()
rc, out, err = module.run_command("/sbin/sysctl -n kern.version") rc, out, err = module.run_command("/sbin/sysctl -n kern.version")
data = re.search('OpenBSD\s[0-9]+.[0-9]+(-\S+)?\s.*', out) match = re.match('OpenBSD\s[0-9]+.[0-9]+-(\S+)\s.*', out)
if data: if match:
self.facts['distribution_version'] = data.groups()[0][1:] self.facts['distribution_version'] = match.groups()[0]
else: else:
self.facts['distribution_version'] = 'release' self.facts['distribution_version'] = 'release'
else: else:

Loading…
Cancel
Save