1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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

This commit is contained in:
Johan Wirén 2013-09-22 14:05:22 +02:00
parent 77508c7bea
commit e9554e5da2

View file

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