| George Keishing | e7e9171 | 2021-09-03 11:28:44 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 2 | r""" | 
| George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 3 | #    @file     openbmc_ffdc_list.py | 
| George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 4 | #    @brief    List for FFDC ( First failure data capture ) | 
|  | 5 | #              commands and files to be collected as a part | 
|  | 6 | #              of the test case failure. | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 7 | """ | 
| Konstantin Aladyshev | c056c2b | 2021-03-25 11:59:39 +0300 | [diff] [blame] | 8 | import os | 
|  | 9 |  | 
| Konstantin Aladyshev | 6788049 | 2021-03-20 17:20:57 +0300 | [diff] [blame] | 10 | from robot.libraries.BuiltIn import BuiltIn | 
|  | 11 |  | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 12 | # ------------------- | 
| George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 13 | # FFDC default list | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 14 | # ------------------- | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 15 | # ----------------------------------------------------------------- | 
| Gunnar Mills | 28e403b | 2017-10-25 16:16:38 -0500 | [diff] [blame] | 16 | # Dict Name {  Index string : { Key String :  Command string} } | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 17 | # ----------------------------------------------------------------- | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 18 | # Add cmd's needed to be part of the ffdc report manifest file | 
|  | 19 | FFDC_BMC_CMD = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 20 | "DRIVER INFO": { | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 21 | # String Name         Command | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 22 | "FW Level": "cat /etc/os-release", | 
|  | 23 | "FW Timestamp": "cat /etc/timestamp", | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 24 | }, | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 25 | "BMC DATA": { | 
|  | 26 | "BMC OS": "uname -a", | 
|  | 27 | "BMC Uptime": "uptime;cat /proc/uptime", | 
|  | 28 | "BMC File System Disk Space Usage": "df -hT", | 
|  | 29 | "BMC Date Time": "date;/sbin/hwclock --show;/usr/bin/timedatectl", | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 30 | }, | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 31 | "APPLICATION DATA": { | 
|  | 32 | "BMC state": "/usr/bin/obmcutil state", | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 33 | }, | 
|  | 34 | } | 
| George Keishing | 671dd66 | 2021-05-28 03:26:30 -0500 | [diff] [blame] | 35 | # Add file name and corresponding command needed for BMC | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 36 | FFDC_BMC_FILE = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 37 | "BMC FILES": { | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 38 | # File Name         Command | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 39 | "BMC_flash_side.txt": ( | 
|  | 40 | "cat /sys/class/watchdog/watchdog1/bootstatus" | 
|  | 41 | " >/tmp/BMC_flash_side.txt 2>&1" | 
|  | 42 | ), | 
|  | 43 | "BMC_hwmon.txt": ( | 
|  | 44 | "grep -r . /sys/class/hwmon/* >/tmp/BMC_hwmon.txt 2>&1" | 
|  | 45 | ), | 
|  | 46 | "BMC_proc_list.txt": "top -n 1 -b >/tmp/BMC_proc_list.txt 2>&1", | 
|  | 47 | "BMC_proc_fd_active_list.txt": ( | 
|  | 48 | "ls -Al /proc/*/fd/ >/tmp/BMC_proc_fd_active_list.txt 2>&1" | 
|  | 49 | ), | 
| Sridevi Ramesh | c42f5bf | 2025-01-13 10:51:39 -0600 | [diff] [blame] | 50 | "BMC_journalctl.txt": ( | 
|  | 51 | "journalctl -o short-precise >/tmp/BMC_journalctl.txt 2>&1" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 52 | ), | 
|  | 53 | "BMC_journalctl_pretty.json": ( | 
|  | 54 | "journalctl -o json-pretty >/tmp/BMC_journalctl_pretty.json 2>&1" | 
|  | 55 | ), | 
|  | 56 | "BMC_dmesg.txt": "dmesg >/tmp/BMC_dmesg.txt 2>&1", | 
|  | 57 | "BMC_procinfo.txt": "cat /proc/cpuinfo >/tmp/BMC_procinfo.txt 2>&1", | 
|  | 58 | "BMC_meminfo.txt": "cat /proc/meminfo >/tmp/BMC_meminfo.txt 2>&1", | 
|  | 59 | "BMC_systemd.txt": "systemctl status --all >/tmp/BMC_systemd.txt 2>&1", | 
|  | 60 | "BMC_failed_service.txt": ( | 
|  | 61 | "systemctl list-units --failed >/tmp/BMC_failed_service.txt 2>&1" | 
|  | 62 | ), | 
|  | 63 | "BMC_list_service.txt": ( | 
|  | 64 | "systemctl list-jobs >/tmp/BMC_list_service.txt 2>&1" | 
|  | 65 | ), | 
|  | 66 | "BMC_obmc_console.txt": ( | 
|  | 67 | "cat /var/log/obmc-console.log >/tmp/BMC_obmc_console.txt 2>&1" | 
|  | 68 | ), | 
|  | 69 | "BMC_obmc_console1.txt": ( | 
|  | 70 | "cat /var/log/obmc-console1.log >/tmp/BMC_obmc_console1.txt 2>&1" | 
|  | 71 | ), | 
| George Keishing | ecf4428 | 2024-05-20 20:44:17 +0530 | [diff] [blame] | 72 | "vpd-inventory.txt": "vpd-tool -i >/tmp/vpd-inventory.txt 2>&1", | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 73 | "PEL_logs_list.json": "peltool -l >/tmp/PEL_logs_list.json 2>&1", | 
|  | 74 | "PEL_logs_complete_list.json": ( | 
|  | 75 | "peltool -l -a -f >/tmp/PEL_logs_complete_list.json 2>&1" | 
|  | 76 | ), | 
|  | 77 | "PEL_logs_display.json": "peltool -a >/tmp/PEL_logs_display.json 2>&1", | 
|  | 78 | "PEL_logs_complete_display.json": ( | 
|  | 79 | "peltool -a -f -h>/tmp/PEL_logs_complete_display.json 2>&1" | 
|  | 80 | ), | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 81 | "PEL_logs_badPEL.txt": ( | 
|  | 82 | "hexdump -C" | 
|  | 83 | + " /var/lib/phosphor-logging/extensions/pels/badPEL>/tmp/PEL_logs_badPEL.txt" | 
|  | 84 | " 2>&1" | 
|  | 85 | ), | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 86 | "PLDM_fru_record.txt": ( | 
|  | 87 | "pldmtool fru getfrurecordtable>/tmp/PLDM_fru_record.txt 2>&1" | 
|  | 88 | ), | 
|  | 89 | "BMC_pldm_flight_recorder.txt": ( | 
|  | 90 | "rm -rf /tmp/pldm_flight_recorder; killall -s SIGUSR1 pldmd;" | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 91 | + " sleep 5; cat /tmp/pldm_flight_recorder >" | 
|  | 92 | " /tmp/BMC_pldm_flight_recorder.txt 2>&1;" | 
|  | 93 | ), | 
|  | 94 | "OCC_state.txt": ( | 
|  | 95 | 'echo "OCC state check";for i in {0..3};' | 
|  | 96 | + " do (echo /org/open_power/control/occ$i;" | 
|  | 97 | + " busctl get-property org.open_power.OCC.Control" | 
|  | 98 | " /org/open_power/control/occ$i" | 
|  | 99 | + " org.open_power.OCC.Status OccActive) done > /tmp/OCC_state.txt" | 
|  | 100 | " 2>&1" | 
|  | 101 | ), | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 102 | "GUARD_list.txt": "guard -l > /tmp/GUARD_list.txt 2>&1", | 
|  | 103 | "fan_control_dump.json": "fanctl dump; sleep 5", | 
| George Keishing | 326e41b | 2023-12-13 14:52:45 +0530 | [diff] [blame] | 104 | "fan_monitor_dump.json": "killall -s SIGUSR1 phosphor-fan-monitor; sleep 5", | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 105 | "DEVTREE": ( | 
|  | 106 | "cat /var/lib/phosphor-software-manager/pnor/rw/DEVTREE >" | 
|  | 107 | " /tmp/DEVTREE 2>&1" | 
|  | 108 | ), | 
| George Keishing | 706785c | 2024-12-04 16:04:32 +0530 | [diff] [blame] | 109 | "kernel_sys_trace.txt": ( | 
|  | 110 | "cat /sys/kernel/tracing/trace >/tmp/kernel_sys_trace.txt 2>&1" | 
|  | 111 | ), | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 112 | }, | 
|  | 113 | } | 
| George Keishing | f9f661d | 2020-03-18 11:42:53 -0500 | [diff] [blame] | 114 | # Add file name and corresponding command needed for all Linux distributions | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 115 | FFDC_OS_ALL_DISTROS_FILE = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 116 | "OS FILES": { | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 117 | # File Name         Command | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 118 | "OS_msglog.txt": ( | 
|  | 119 | "cat /sys/firmware/opal/msglog >/tmp/OS_msglog.txt 2>&1" | 
|  | 120 | ), | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 121 | "OS_cpufrequency.txt": ( | 
|  | 122 | "ppc64_cpu --frequency >/tmp/OS_cpufrequency.txt 2>&1" | 
|  | 123 | ), | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 124 | "OS_dmesg.txt": "dmesg >/tmp/OS_dmesg.txt 2>&1", | 
|  | 125 | "OS_opal_prd.txt": "cat /var/log/opal-prd* >/tmp/OS_opal_prd.txt 2>&1", | 
|  | 126 | "OS_boot.txt": "cat /var/log/boot.log >/tmp/OS_boot.txt 2>&1", | 
|  | 127 | "OS_procinfo.txt": "cat /proc/cpuinfo >/tmp/OS_procinfo.txt 2>&1", | 
|  | 128 | "OS_meminfo.txt": "cat /proc/meminfo >/tmp/OS_meminfo.txt 2>&1", | 
|  | 129 | "OS_netstat.txt": "netstat -a >/tmp/OS_netstat.txt 2>&1", | 
|  | 130 | "OS_lspci.txt": "lspci >/tmp/OS_lspci.txt 2>&1", | 
|  | 131 | "OS_lscpu.txt": "lscpu >/tmp/OS_lscpu.txt 2>&1", | 
|  | 132 | "OS_lscfg.txt": "lscfg >/tmp/OS_lscfg.txt 2>&1", | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 133 | "OS_journalctl_nopager.txt": ( | 
|  | 134 | "journalctl --no-pager -b " | 
|  | 135 | + "> /tmp/OS_journalctl_nopager.txt  2>&1" | 
|  | 136 | ), | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 137 | }, | 
|  | 138 | } | 
| George Keishing | 671dd66 | 2021-05-28 03:26:30 -0500 | [diff] [blame] | 139 | # Add file name and corresponding command needed for Ubuntu Linux | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 140 | FFDC_OS_UBUNTU_FILE = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 141 | "OS FILES": { | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 142 | # File Name         Command | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 143 | "OS_isusb.txt": "{ lsusb -t ; lsusb -v ; } >/tmp/OS_isusb.txt 2>&1", | 
|  | 144 | "OS_kern.txt": ( | 
|  | 145 | "tail -n 50000 /var/log/kern.log >/tmp/OS_kern.txt 2>&1" | 
|  | 146 | ), | 
|  | 147 | "OS_authlog.txt": ( | 
|  | 148 | "{ cat /var/log/auth.log; cat /var/log/auth.log.1 ; } " | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 149 | + ">/tmp/OS_authlog.txt 2>&1" | 
|  | 150 | ), | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 151 | "OS_syslog.txt": ( | 
|  | 152 | "tail -n 200000 /var/log/syslog >/tmp/OS_syslog.txt 2>&1" | 
|  | 153 | ), | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 154 | "OS_info.txt": ( | 
|  | 155 | "{ uname -a; dpkg -s opal-prd; dpkg -s ipmitool ; } " | 
|  | 156 | + ">/tmp/OS_info.txt 2>&1" | 
|  | 157 | ), | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 158 | "OS_sosreport.txt": ( | 
|  | 159 | "{ rm -rf /tmp/sosreport*FFDC* ; sosreport --batch --tmp-dir " | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 160 | + "/tmp --ticket-number FFDC ; } >/tmp/OS_sosreport.txt 2>&1" | 
|  | 161 | ), | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 162 | }, | 
|  | 163 | } | 
| George Keishing | 671dd66 | 2021-05-28 03:26:30 -0500 | [diff] [blame] | 164 | # Add file name and corresponding command needed for RHEL Linux | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 165 | FFDC_OS_RHEL_FILE = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 166 | "OS FILES": { | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 167 | # File Name         Command | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 168 | "OS_rsct.txt": "/usr/bin/ctversion -bv >/tmp/OS_rsct.txt 2>&1", | 
|  | 169 | "OS_secure.txt": "cat /var/log/secure >/tmp/OS_secure.txt 2>&1", | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 170 | "OS_syslog.txt": ( | 
|  | 171 | "tail -n 200000 /var/log/messages >/tmp/OS_syslog.txt 2>&1" | 
|  | 172 | ), | 
|  | 173 | "OS_info.txt": ( | 
|  | 174 | "{ lsb_release -a; cat /etc/redhat-release; " | 
|  | 175 | + "uname -a; rpm -qa ; } >/tmp/OS_info.txt 2>&1" | 
|  | 176 | ), | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 177 | "OS_sosreport.txt": ( | 
|  | 178 | "{ rm -rf /tmp/sosreport*FFDC* ; sosreport --batch --tmp-dir " | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 179 | + "/tmp --label FFDC ; } >/tmp/OS_sosreport.txt 2>&1" | 
|  | 180 | ), | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 181 | }, | 
|  | 182 | } | 
| George Keishing | 671dd66 | 2021-05-28 03:26:30 -0500 | [diff] [blame] | 183 | # Add file name and corresponding command needed for AIX. | 
|  | 184 | FFDC_OS_AIX_FILE = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 185 | "OS FILES": { | 
| George Keishing | 671dd66 | 2021-05-28 03:26:30 -0500 | [diff] [blame] | 186 | # File Name         Command | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 187 | "OS_errpt.txt": "errpt >/tmp/OS_errpt.txt 2>&1 ; errclear 0;", | 
|  | 188 | "OS_processors.txt": "bindprocessor -q >/tmp/OS_processors.txt 2>&1", | 
| George Keishing | 671dd66 | 2021-05-28 03:26:30 -0500 | [diff] [blame] | 189 | }, | 
|  | 190 | } | 
| George Keishing | 1970076 | 2020-01-22 12:32:53 -0600 | [diff] [blame] | 191 |  | 
| George Keishing | a5bbc30 | 2021-10-04 22:30:55 -0500 | [diff] [blame] | 192 | try: | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 193 | redfish_support_trans_state = os.environ.get( | 
|  | 194 | "REDFISH_SUPPORT_TRANS_STATE", 0 | 
|  | 195 | ) or int( | 
|  | 196 | BuiltIn().get_variable_value( | 
|  | 197 | "${REDFISH_SUPPORT_TRANS_STATE}", default=0 | 
|  | 198 | ) | 
|  | 199 | ) | 
| George Keishing | a5bbc30 | 2021-10-04 22:30:55 -0500 | [diff] [blame] | 200 | except RobotNotRunningError: | 
|  | 201 | pass | 
|  | 202 |  | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 203 | OPENBMC_BASE = "/xyz/openbmc_project/" | 
|  | 204 | OPENPOWER_BASE = "/org/open_power/" | 
|  | 205 | ENUMERATE_SENSORS = OPENBMC_BASE + "sensors/enumerate" | 
|  | 206 | ENUMERATE_INVENTORY = OPENBMC_BASE + "inventory/enumerate" | 
|  | 207 | ENUMERATE_ELOG = OPENBMC_BASE + "logging/entry/enumerate" | 
|  | 208 | ENUMERATE_LED = OPENBMC_BASE + "led/enumerate" | 
|  | 209 | ENUMERATE_SW = OPENBMC_BASE + "software/enumerate" | 
|  | 210 | ENUMERATE_CONTROL = OPENBMC_BASE + "control/enumerate" | 
|  | 211 | ENUMERATE_STATE = OPENBMC_BASE + "state/enumerate" | 
|  | 212 | ENUMERATE_OCC = OPENPOWER_BASE + "/enumerate" | 
|  | 213 | ENUMERATE_DUMPS = OPENBMC_BASE + "dumps/enumerate" | 
|  | 214 | ENUMERATE_USER = OPENBMC_BASE + "user/enumerate" | 
| Sweta Potthuri | a82efd6 | 2017-10-18 05:34:59 -0500 | [diff] [blame] | 215 |  | 
| George Keishing | 671dd66 | 2021-05-28 03:26:30 -0500 | [diff] [blame] | 216 | # Add file name and corresponding Get Request | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 217 | FFDC_GET_REQUEST = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 218 | "GET REQUESTS": { | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 219 | # File Name         Command | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 220 | "FIRMWARE_list.txt": ENUMERATE_SW, | 
|  | 221 | "BMC_sensor_list.txt": ENUMERATE_SENSORS, | 
|  | 222 | "BMC_control_list.txt": ENUMERATE_CONTROL, | 
|  | 223 | "BMC_inventory.txt": ENUMERATE_INVENTORY, | 
|  | 224 | "BMC_elog.txt": ENUMERATE_ELOG, | 
|  | 225 | "BMC_led.txt": ENUMERATE_LED, | 
|  | 226 | "BMC_state.txt": ENUMERATE_STATE, | 
|  | 227 | "OCC_state.txt": ENUMERATE_OCC, | 
|  | 228 | "BMC_dumps.txt": ENUMERATE_DUMPS, | 
|  | 229 | "BMC_USER.txt": ENUMERATE_USER, | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 230 | }, | 
|  | 231 | } | 
| George Keishing | 8c42bbc | 2021-09-28 14:52:54 -0500 | [diff] [blame] | 232 |  | 
| George Keishing | a5bbc30 | 2021-10-04 22:30:55 -0500 | [diff] [blame] | 233 | # Remove the REST dictionary elements. | 
|  | 234 | if redfish_support_trans_state == 1: | 
|  | 235 | for key in list(FFDC_GET_REQUEST): | 
|  | 236 | del FFDC_GET_REQUEST[key] | 
|  | 237 |  | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 238 | REDFISH_BASE = "/redfish/v1/" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 239 | REDFISH_FIRMWARE = REDFISH_BASE + "UpdateService/FirmwareInventory" | 
| George Keishing | 8c42bbc | 2021-09-28 14:52:54 -0500 | [diff] [blame] | 240 |  | 
| Yi Hu | c32434a | 2024-01-11 17:33:10 -0800 | [diff] [blame] | 241 | try: | 
|  | 242 | REDFISH_SYSTEM_ID = REDFISH_SYSTEM_ID = os.environ.get( | 
|  | 243 | "SYSTEM_ID", "" | 
|  | 244 | ) or BuiltIn().get_variable_value("${SYSTEM_ID}", default="system") | 
|  | 245 |  | 
|  | 246 | REDFISH_ELOG = ( | 
|  | 247 | REDFISH_BASE | 
|  | 248 | + "Systems/" | 
|  | 249 | + REDFISH_SYSTEM_ID | 
|  | 250 | + "/LogServices/EventLog/Entries" | 
|  | 251 | ) | 
|  | 252 | except RobotNotRunningError: | 
|  | 253 | REDFISH_ELOG = REDFISH_BASE + "Systems/system/LogServices/EventLog/Entries" | 
|  | 254 | pass | 
|  | 255 |  | 
| George Keishing | 8c42bbc | 2021-09-28 14:52:54 -0500 | [diff] [blame] | 256 | # Add file name and corresponding Get Request | 
|  | 257 | FFDC_GET_REDFISH_REQUEST = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 258 | "GET REQUESTS": { | 
| George Keishing | 8c42bbc | 2021-09-28 14:52:54 -0500 | [diff] [blame] | 259 | # File Name         Command | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 260 | "BMC_redfish_elog.txt": REDFISH_ELOG, | 
| George Keishing | 8c42bbc | 2021-09-28 14:52:54 -0500 | [diff] [blame] | 261 | }, | 
|  | 262 | } | 
|  | 263 |  | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 264 | # Define your keywords in method/utils and call here | 
|  | 265 | FFDC_METHOD_CALL = { | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 266 | "BMC LOGS": { | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 267 | # Description               Keyword name | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 268 | "Start ffdc cleanup": "BMC FFDC Cleanup", | 
|  | 269 | "FFDC Generic Report": "BMC FFDC Manifest", | 
|  | 270 | "BMC Specific Files": "BMC FFDC Files", | 
|  | 271 | "Get Request FFDC": "BMC FFDC Get Requests", | 
|  | 272 | "Get Redfish Request FFDC": "BMC FFDC Get Redfish Requests", | 
|  | 273 | "OS FFDC": "OS FFDC Files", | 
|  | 274 | "Core Files": "SCP Coredump Files", | 
|  | 275 | "SEL Log": "Collect eSEL Log", | 
|  | 276 | "Sys Inventory Files": "System Inventory Files", | 
|  | 277 | "Dump Files": "SCP Dump Files", | 
|  | 278 | "PEL Files": "Collect PEL Log", | 
| George Keishing | 2062cc4 | 2022-02-25 06:48:21 -0600 | [diff] [blame] | 279 | # "Redfish Log": "Enumerate Redfish Resources", | 
| George Keishing | 15914c0 | 2025-04-15 13:23:42 +0530 | [diff] [blame] | 280 | "Log Redfish Session Count": "Get BMC Active Session Count", | 
| George Keishing | 4afd655 | 2023-02-06 03:08:04 -0600 | [diff] [blame] | 281 | "Firmware Log": ( | 
|  | 282 | "Enumerate Redfish Resources  " | 
|  | 283 | + " enum_uri=/redfish/v1/UpdateService/FirmwareInventory  " | 
|  | 284 | + " file_enum_name=redfish_FIRMWARE_list.txt" | 
|  | 285 | ), | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 286 | "Redfish OEM Log": "Enumerate Redfish OEM Resources", | 
|  | 287 | "End ffdc cleanup": "BMC FFDC Cleanup", | 
| George Keishing | 15914c0 | 2025-04-15 13:23:42 +0530 | [diff] [blame] | 288 | "Cleanup sessions": "Delete All Redfish Sessions", | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 289 | }, | 
|  | 290 | } | 
| Konstantin Aladyshev | 6788049 | 2021-03-20 17:20:57 +0300 | [diff] [blame] | 291 |  | 
| George Keishing | 4b4eef7 | 2021-04-01 02:31:42 -0500 | [diff] [blame] | 292 | try: | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 293 | platform_arch_type = os.environ.get( | 
|  | 294 | "PLATFORM_ARCH_TYPE", "" | 
|  | 295 | ) or BuiltIn().get_variable_value("${PLATFORM_ARCH_TYPE}", default="power") | 
| George Keishing | 4b4eef7 | 2021-04-01 02:31:42 -0500 | [diff] [blame] | 296 | except RobotNotRunningError: | 
|  | 297 | pass | 
|  | 298 |  | 
| Konstantin Aladyshev | 6788049 | 2021-03-20 17:20:57 +0300 | [diff] [blame] | 299 | # Filter the logs based on platform type. | 
|  | 300 | if platform_arch_type == "x86": | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 301 | del FFDC_BMC_FILE["BMC FILES"]["PEL_logs_list.json"] | 
|  | 302 | del FFDC_BMC_FILE["BMC FILES"]["PEL_logs_display.json"] | 
|  | 303 | del FFDC_METHOD_CALL["BMC LOGS"]["PEL Files"] | 
| Konstantin Aladyshev | 6788049 | 2021-03-20 17:20:57 +0300 | [diff] [blame] | 304 |  | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 305 | # ----------------------------------------------------------------- | 
| George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 306 | # base class for FFDC default list | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 307 |  | 
|  | 308 |  | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 309 | class openbmc_ffdc_list: | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 310 | def get_ffdc_bmc_cmd(self, i_type): | 
|  | 311 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 312 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 313 | #   @brief    This method returns the list from the dictionary for cmds | 
|  | 314 | #   @param    i_type: @type string: string index lookup | 
|  | 315 | #   @return   List of key pair from the dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 316 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 317 | """ | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 318 | return FFDC_BMC_CMD[i_type].items() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 319 |  | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 320 | def get_ffdc_bmc_file(self, i_type): | 
|  | 321 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 322 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 323 | #   @brief    This method returns the list from the dictionary for scp | 
|  | 324 | #   @param    i_type: @type string: string index lookup | 
|  | 325 | #   @return   List of key pair from the dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 326 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 327 | """ | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 328 | return FFDC_BMC_FILE[i_type].items() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 329 |  | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 330 | def get_ffdc_get_request(self, i_type): | 
|  | 331 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 332 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 333 | #   @brief    This method returns the list from the dictionary for scp | 
|  | 334 | #   @param    i_type: @type string: string index lookup | 
|  | 335 | #   @return   List of key pair from the dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 336 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 337 | """ | 
|  | 338 | return FFDC_GET_REQUEST[i_type].items() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 339 |  | 
| George Keishing | 8c42bbc | 2021-09-28 14:52:54 -0500 | [diff] [blame] | 340 | def get_ffdc_get_redfish_request(self, i_type): | 
|  | 341 | r""" | 
|  | 342 | ####################################################################### | 
|  | 343 | #   @brief    This method returns the list from the dictionary for scp | 
|  | 344 | #   @param    i_type: @type string: string index lookup | 
|  | 345 | #   @return   List of key pair from the dictionary | 
|  | 346 | ####################################################################### | 
|  | 347 | """ | 
|  | 348 | return FFDC_GET_REDFISH_REQUEST[i_type].items() | 
|  | 349 |  | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 350 | def get_ffdc_cmd_index(self): | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 351 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 352 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 353 | #   @brief    This method returns the list index from dictionary | 
|  | 354 | #   @return   List of index to the dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 355 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 356 | """ | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 357 | return FFDC_BMC_CMD.keys() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 358 |  | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 359 | def get_ffdc_get_request_index(self): | 
|  | 360 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 361 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 362 | #   @brief    This method returns the list index from dictionary | 
|  | 363 | #   @return   List of index to the dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 364 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 365 | """ | 
|  | 366 | return FFDC_GET_REQUEST.keys() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 367 |  | 
| George Keishing | 8c42bbc | 2021-09-28 14:52:54 -0500 | [diff] [blame] | 368 | def get_ffdc_get_redfish_request_index(self): | 
|  | 369 | r""" | 
|  | 370 | ####################################################################### | 
|  | 371 | #   @brief    This method returns the list index from dictionary | 
|  | 372 | #   @return   List of index to the dictionary | 
|  | 373 | ####################################################################### | 
|  | 374 | """ | 
|  | 375 | return FFDC_GET_REDFISH_REQUEST.keys() | 
|  | 376 |  | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 377 | def get_ffdc_file_index(self): | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 378 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 379 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 380 | #   @brief    This method returns the list index from dictionary | 
|  | 381 | #   @return   List of index to the dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 382 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 383 | """ | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 384 | return FFDC_BMC_FILE.keys() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 385 |  | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 386 | def get_ffdc_method_index(self): | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 387 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 388 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 389 | #   @brief    This method returns the key pair from the dictionary | 
|  | 390 | #   @return   Index of the method dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 391 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 392 | """ | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 393 | return FFDC_METHOD_CALL.keys() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 394 |  | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 395 | def get_ffdc_method_desc(self, index): | 
| Michael Walsh | e844e9a | 2017-04-20 16:51:10 -0500 | [diff] [blame] | 396 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 397 | ####################################################################### | 
| Michael Walsh | e844e9a | 2017-04-20 16:51:10 -0500 | [diff] [blame] | 398 | #   @brief   This method returns the just the keys from the dictionary. | 
|  | 399 | #   @return  List of ffdc descriptions. | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 400 | ####################################################################### | 
| Michael Walsh | e844e9a | 2017-04-20 16:51:10 -0500 | [diff] [blame] | 401 | """ | 
|  | 402 | return FFDC_METHOD_CALL[index].keys() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 403 |  | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 404 | def get_ffdc_method_call(self, i_type): | 
|  | 405 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 406 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 407 | #   @brief    This method returns the key pair from the dictionary | 
|  | 408 | #   @return   List of key pair keywords | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 409 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 410 | """ | 
| George Keishing | 69e6f71 | 2016-09-12 06:30:09 -0500 | [diff] [blame] | 411 | return FFDC_METHOD_CALL[i_type].items() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 412 |  | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 413 | def get_ffdc_os_all_distros_index(self): | 
|  | 414 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 415 | ####################################################################### | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 416 | #   @brief    This method returns the key pair from the dictionary | 
|  | 417 | #   @return   Index of the method dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 418 | ####################################################################### | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 419 | """ | 
|  | 420 | return FFDC_OS_ALL_DISTROS_FILE.keys() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 421 |  | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 422 | def get_ffdc_os_all_distros_call(self, i_type): | 
|  | 423 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 424 | ####################################################################### | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 425 | #   @brief    This method returns the key pair from the dictionary | 
|  | 426 | #   @return   List of key pair keywords | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 427 | ####################################################################### | 
| Gunnar Mills | 7e2cda2 | 2016-10-11 15:37:34 -0500 | [diff] [blame] | 428 | """ | 
|  | 429 | return FFDC_OS_ALL_DISTROS_FILE[i_type].items() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 430 |  | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 431 | def get_ffdc_os_distro_index(self, distro): | 
|  | 432 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 433 | ####################################################################### | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 434 | #   @brief    This method returns the key pair from the dictionary | 
|  | 435 | #   @return   Index of the method dictionary | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 436 | ####################################################################### | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 437 | """ | 
|  | 438 | distro_file = "FFDC_OS_" + str(distro).upper() + "_FILE" | 
|  | 439 | return eval(distro_file).keys() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 440 |  | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 441 | def get_ffdc_os_distro_call(self, i_type, distro): | 
|  | 442 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 443 | ####################################################################### | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 444 | #   @brief    This method returns the key pair from the dictionary | 
|  | 445 | #   @return   List of key pair keywords | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 446 | ####################################################################### | 
| Gunnar Mills | cce185d | 2016-10-17 17:04:15 -0500 | [diff] [blame] | 447 | """ | 
|  | 448 | distro_file = "FFDC_OS_" + str(distro).upper() + "_FILE" | 
|  | 449 | return eval(distro_file)[i_type].items() | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 450 |  | 
| George Keishing | 4346a41 | 2016-07-19 11:26:49 -0500 | [diff] [blame] | 451 | def get_strip_string(self, i_str): | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 452 | r""" | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 453 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 454 | #   @brief    Returns the stripped strings | 
|  | 455 | #   @param    i_str: @type string: string name | 
|  | 456 | #   @return   Remove all special chars and return the string | 
| Joy Onyerikwu | 004ad3c | 2018-06-11 16:29:56 -0500 | [diff] [blame] | 457 | ####################################################################### | 
| Gunnar Mills | a812e0f | 2016-09-29 20:30:03 -0500 | [diff] [blame] | 458 | """ | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 459 | return "".join(e for e in i_str if e.isalnum()) | 
| Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 460 |  | 
| George Keishing | 28da948 | 2017-07-27 13:38:54 -0500 | [diff] [blame] | 461 | def get_esel_index(self, esel_list): | 
|  | 462 | r""" | 
|  | 463 | ####################################################################### | 
|  | 464 | #   @brief    Returns the eSEL binary index. | 
|  | 465 | #   @param    esel_ist: @type list: eSEL list. | 
|  | 466 | #   @return   Index of "ESEL=" in the list. | 
|  | 467 | ####################################################################### | 
|  | 468 | """ | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 469 | index = [i for i, str in enumerate(esel_list) if "ESEL=" in str] | 
| George Keishing | 28da948 | 2017-07-27 13:38:54 -0500 | [diff] [blame] | 470 | return index[0] | 
| Sweta Potthuri | a82efd6 | 2017-10-18 05:34:59 -0500 | [diff] [blame] | 471 |  | 
|  | 472 | def get_dump_index(self, dump_list): | 
|  | 473 | r""" | 
|  | 474 | ####################################################################### | 
|  | 475 | #   @brief    Returns the eSEL binary index. | 
|  | 476 | #   @param    esel_ist: @type list: eSEL list. | 
|  | 477 | #   @return   Index of "ESEL=" in the list. | 
|  | 478 | ####################################################################### | 
|  | 479 | """ | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 480 | index = [i for i, str in enumerate(dump_list) if "DUMP=" in str] | 
| Sweta Potthuri | a82efd6 | 2017-10-18 05:34:59 -0500 | [diff] [blame] | 481 | return index[0] |