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

Merge pull request #7198 from Logos01/devel

Enable facts module on older SuSE systems (Resolves #7032)
This commit is contained in:
James Cammarata 2014-04-28 21:49:18 -05:00
commit 5c39206014

View file

@ -303,7 +303,9 @@ class Facts(object):
self.facts['distribution_release'] = ora_prefix + data
elif name == 'SuSE':
data = get_file_content(path).splitlines()
self.facts['distribution_release'] = data[2].split('=')[1].strip()
for line in data:
if '=' in line:
self.facts['distribution_release'] = line.split('=')[1].strip()
elif name == 'Debian':
data = get_file_content(path).split('\n')[0]
release = re.search("PRETTY_NAME.+ \(?([^ ]+?)\)?\"", data)