Browse code

fix for when calling bootinfo throws permmission errors (AIX) fixes https://github.com/ansible/ansible-modules-core/issues/1108

Brian Coca authored on 2015/04/08 16:30:21
Showing 1 changed files
... ...
@@ -172,9 +172,12 @@ class Facts(object):
172 172
         if self.facts['system'] == 'Linux':
173 173
             self.get_distribution_facts()
174 174
         elif self.facts['system'] == 'AIX':
175
-            rc, out, err = module.run_command("/usr/sbin/bootinfo -p")
176
-            data = out.split('\n')
177
-            self.facts['architecture'] = data[0]
175
+            try:
176
+                rc, out, err = module.run_command("/usr/sbin/bootinfo -p")
177
+                data = out.split('\n')
178
+                self.facts['architecture'] = data[0]
179
+            except:
180
+                self.facts['architectrure' = 'Not Available'
178 181
         elif self.facts['system'] == 'OpenBSD':
179 182
             self.facts['architecture'] = platform.uname()[5]
180 183