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

Use first line from /etc/release in "distribution_release" for consistency across Solaris and derivatives.

This commit is contained in:
Chris Gardner 2013-06-03 22:33:01 +01:00
parent f0a4a17ff6
commit 2ba47318dc

View file

@ -238,13 +238,13 @@ class Facts(object):
self.facts['distribution_version'] = data
elif name == 'Solaris':
data = get_file_content(path).split('\n')[0]
ora_prefix = ''
if 'Oracle Solaris' in data:
data = " ".join(data.split()[1:None])
data = data.replace('Oracle ','')
ora_prefix = 'Oracle '
self.facts['distribution'] = data.split()[0]
self.facts['distribution_version'] = data.split()[1]
distribution_release = " ".join(data.split()[2:None])
if distribution_release != 'X86' and distribution_release != 'SPARC':
self.facts['distribution_release'] = distribution_release
self.facts['distribution_release'] = ora_prefix + data
else:
self.facts['distribution'] = name