Allows to fetch machine architecture as an unprivileged user

pull/9225/head
Jonathan Süssemilch Poulain 10 years ago committed by Jonathan Süssemilch Poulain
parent 9aa4214417
commit e181bcf62b

@ -186,16 +186,21 @@ class Facts(object):
if self.facts['system'] == 'Linux':
self.get_distribution_facts()
elif self.facts['system'] == 'AIX':
try:
rc, out, err = module.run_command("/usr/sbin/bootinfo -p")
# Attempt to use getconf to figure out architechture
# fall back to bootinfo if needed
if module.get_bin_path('getconf'):
rc, out, err = module.run_command([module.get_bin_path('getconf'),
'MACHINE_ARCHITECTURE'])
data = out.split('\n')
self.facts['architecture'] = data[0]
else:
rc, out, err = module.run_command([module.get_bin_path('bootinfo'),
'-p'])
data = out.split('\n')
self.facts['architecture'] = data[0]
except:
self.facts['architecture'] = 'Not Available'
elif self.facts['system'] == 'OpenBSD':
self.facts['architecture'] = platform.uname()[5]
def get_local_facts(self):
fact_path = module.params.get('fact_path', None)

Loading…
Cancel
Save