Fix fact ansible_distribution_version for AIX (#48570)

* Fix fact ansible_distribution_version for AIX

* aix_facts: Check oslevel output
This commit is contained in:
jokurz 2018-11-28 01:43:07 +01:00 committed by Brian Coca
parent ae2467ddbc
commit 6404c6484c

View file

@ -503,8 +503,11 @@ class Distribution(object):
rc, out, err = self.module.run_command("/usr/bin/oslevel")
data = out.split('.')
aix_facts['distribution_major_version'] = data[0]
aix_facts['distribution_version'] = data[0]
aix_facts['distribution_release'] = data[1]
if len(data) > 1:
aix_facts['distribution_version'] = '%s.%s' % (data[0], data[1])
aix_facts['distribution_release'] = data[1]
else:
aix_facts['distribution_version'] = data[0]
return aix_facts
def get_distribution_HPUX(self):