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

Fix detecting distribution release on OpenSuSE

Ansible raised exception during parsering /etc/SuSE-release file.
Regular expresion should use string instead of list.
Fix tested on OpenSuse 13.1
This commit is contained in:
Marcin Praczko 2014-10-13 22:57:03 +02:00
parent 617352a38e
commit 1917906dd6

View file

@ -328,7 +328,8 @@ class Facts(object):
break break
elif path == '/etc/SuSE-release': elif path == '/etc/SuSE-release':
data = data.splitlines() data = data.splitlines()
release = re.search('CODENAME *= *([^\n]+)\n', data) for line in data:
release = re.search('CODENAME *= *([^\n]+)', line)
if release: if release:
self.facts['distribution_release'] = release.groups()[0].strip() self.facts['distribution_release'] = release.groups()[0].strip()
break break