From 1c796543c9d9e46c0beefb9b3f6d22d4d97f875b Mon Sep 17 00:00:00 2001
From: Brian Coca <brian.coca+git@gmail.com>
Date: Wed, 8 Apr 2015 03:30:21 -0400
Subject: [PATCH] fix for when calling bootinfo throws permmission errors (AIX)
 fixes https://github.com/ansible/ansible-modules-core/issues/1108

---
 lib/ansible/module_utils/facts.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index 628d1dd2678..21bbc93d4d1 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -172,9 +172,12 @@ class Facts(object):
         if self.facts['system'] == 'Linux':
             self.get_distribution_facts()
         elif self.facts['system'] == 'AIX':
-            rc, out, err = module.run_command("/usr/sbin/bootinfo -p")
-            data = out.split('\n')
-            self.facts['architecture'] = data[0]
+            try:
+                rc, out, err = module.run_command("/usr/sbin/bootinfo -p")
+                data = out.split('\n')
+                self.facts['architecture'] = data[0]
+            except:
+                self.facts['architectrure' = 'Not Available'
         elif self.facts['system'] == 'OpenBSD':
             self.facts['architecture'] = platform.uname()[5]