Add FFDC support for AIX OS

Changes:
     - Add support for AIX FFDC
     - Typo fixes

Change-Id: I2488704ec6a610272555b4631d3fd7b9630bd3af
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/openbmc_ffdc_list.py b/lib/openbmc_ffdc_list.py
index e2c4a64..cacb95f 100755
--- a/lib/openbmc_ffdc_list.py
+++ b/lib/openbmc_ffdc_list.py
@@ -35,7 +35,7 @@
         'BMC state': '/usr/bin/obmcutil state',
     },
 }
-# Add file name and correcponding command needed for BMC
+# Add file name and corresponding command needed for BMC
 FFDC_BMC_FILE = {
     'BMC FILES':
     {
@@ -79,7 +79,7 @@
         + '> /tmp/OS_journalctl_nopager.txt  2>&1',
     },
 }
-# Add file name and correcponding command needed for Ubuntu Linux
+# Add file name and corresponding command needed for Ubuntu Linux
 FFDC_OS_UBUNTU_FILE = {
     'OS FILES':
     {
@@ -95,7 +95,7 @@
         + '/tmp --ticket-number FFDC ; } >/tmp/OS_sosreport.txt 2>&1',
     },
 }
-# Add file name and correcponding command needed for RHEL Linux
+# Add file name and corresponding command needed for RHEL Linux
 FFDC_OS_RHEL_FILE = {
     'OS FILES':
     {
@@ -110,6 +110,15 @@
         + '/tmp --label FFDC ; } >/tmp/OS_sosreport.txt 2>&1',
     },
 }
+# Add file name and corresponding command needed for AIX.
+FFDC_OS_AIX_FILE = {
+    'OS FILES':
+    {
+        # File Name         Command
+        'OS_errpt.txt': 'errpt >/tmp/OS_errpt.txt 2>&1 ; errclear 0;',
+        'OS_processors.txt': 'bindprocessor -q >/tmp/OS_processors.txt 2>&1',
+    },
+}
 
 OPENBMC_BASE = '/xyz/openbmc_project/'
 OPENPOWER_BASE = '/org/open_power/'
@@ -124,7 +133,7 @@
 ENUMERATE_DUMPS = OPENBMC_BASE + 'dumps/enumerate'
 ENUMERATE_USER = OPENBMC_BASE + 'user/enumerate'
 
-# Add file name and correcponding Get Request
+# Add file name and corresponding Get Request
 FFDC_GET_REQUEST = {
     'GET REQUESTS':
     {
diff --git a/lib/openbmc_ffdc_methods.robot b/lib/openbmc_ffdc_methods.robot
index 3382abb..b6cb128 100755
--- a/lib/openbmc_ffdc_methods.robot
+++ b/lib/openbmc_ffdc_methods.robot
@@ -344,6 +344,8 @@
     # key_index  The index into the FFDC_OS_<distro>_FILE dictionary.
     # linux_distro  Your OS's linux distro (e.g. "UBUNTU", "RHEL", etc).
 
+    Log To Console  Collecting log for ${linux_distro}
+
     @{ffdc_file_list}=  Create List
 
     @{cmd_list}=  Get FFDC OS Distro Call  ${key_index}  ${linux_distro}
@@ -404,8 +406,8 @@
     ...  AND
     ...  Return From Keyword  ${ffdc_file_list}
 
-    ${stdout}  ${stderr}  ${rc}=  OS Execute Command
-    ...  . /etc/os-release; echo $ID  ignore_err=${0}
+    ${stdout}=  OS Distro Type
+
     Set Global Variable  ${linux_distro}  ${stdout}
 
     Rpvars  linux_distro
@@ -643,3 +645,17 @@
     Run  ${cmd_buf}
     # The .binary file, which is generated by eSEL.pl, is of no use to us.
     Remove File  ${esel_file_path}.binary
+
+
+OS Distro Type
+   [Documentation]  Determine the host partition distro type
+
+    ${stdout}  ${stderr}  ${rc}=  OS Execute Command
+    ...  . /etc/os-release; echo $ID  ignore_err=${1}
+
+    Return From Keyword If  ${rc} == ${0}  ${stdout}
+
+    # If linux distro doesnt have os-release, check for uname.
+    ${stdout}  ${stderr}  ${rc}=  OS Execute Command  uname  ignore_err=${0}
+
+   [Return]  ${stdout}