George Keishing | e7e9171 | 2021-09-03 11:28:44 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Rahul Maheshwari | faa5d20 | 2020-02-24 23:32:57 -0600 | [diff] [blame] | 2 | |
| 3 | r""" |
| 4 | PEL functions. |
| 5 | """ |
| 6 | |
Rahul Maheshwari | faa5d20 | 2020-02-24 23:32:57 -0600 | [diff] [blame] | 7 | import json |
George Keishing | 48ffa2c | 2022-02-17 01:42:41 -0600 | [diff] [blame] | 8 | import os |
| 9 | import sys |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 10 | from datetime import datetime |
| 11 | |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 12 | import bmc_ssh_utils as bsu |
| 13 | import func_args as fa |
George Keishing | 48ffa2c | 2022-02-17 01:42:41 -0600 | [diff] [blame] | 14 | |
| 15 | base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 16 | sys.path.append(base_path + "/data/") |
| 17 | |
George Keishing | 0967989 | 2022-12-08 08:21:52 -0600 | [diff] [blame] | 18 | import pel_variables # NOQA |
George Keishing | 37c58c8 | 2022-12-08 07:42:54 -0600 | [diff] [blame] | 19 | |
Rahul Maheshwari | faa5d20 | 2020-02-24 23:32:57 -0600 | [diff] [blame] | 20 | |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 21 | class PeltoolException(Exception): |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 22 | r""" |
| 23 | Base class for peltool related exceptions. |
| 24 | """ |
George Keishing | 48ffa2c | 2022-02-17 01:42:41 -0600 | [diff] [blame] | 25 | |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 26 | def __init__(self, message): |
| 27 | self.message = message |
| 28 | super().__init__(self.message) |
| 29 | |
| 30 | |
Michael Walsh | a20876d | 2020-03-18 16:32:37 -0500 | [diff] [blame] | 31 | def peltool(option_string, parse_json=True, **bsu_options): |
Rahul Maheshwari | faa5d20 | 2020-02-24 23:32:57 -0600 | [diff] [blame] | 32 | r""" |
| 33 | Run peltool on the BMC with the caller's option string and return the result. |
| 34 | |
| 35 | Example: |
| 36 | |
| 37 | ${pel_results}= Peltool -l |
| 38 | Rprint Vars pel_results |
| 39 | |
| 40 | pel_results: |
| 41 | [0x50000031]: |
| 42 | [CompID]: 0x1000 |
| 43 | [PLID]: 0x50000031 |
| 44 | [Subsystem]: BMC Firmware |
| 45 | [Message]: An application had an internal failure |
| 46 | [SRC]: BD8D1002 |
| 47 | [Commit Time]: 02/25/2020 04:51:31 |
| 48 | [Sev]: Unrecoverable Error |
| 49 | [CreatorID]: BMC |
| 50 | |
| 51 | Description of argument(s): |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 52 | option_string A string of options which are to be |
| 53 | processed by the peltool command. |
| 54 | parse_json Indicates that the raw JSON data should |
| 55 | parsed into a list of dictionaries. |
| 56 | bsu_options Options to be passed directly to |
| 57 | bmc_execute_command. See its prolog for |
Michael Walsh | a20876d | 2020-03-18 16:32:37 -0500 | [diff] [blame] | 58 | details. |
Rahul Maheshwari | faa5d20 | 2020-02-24 23:32:57 -0600 | [diff] [blame] | 59 | """ |
| 60 | |
| 61 | bsu_options = fa.args_to_objects(bsu_options) |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 62 | out_buf, _, _ = bsu.bmc_execute_command( |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 63 | "peltool " + option_string, **bsu_options |
| 64 | ) |
Michael Walsh | a20876d | 2020-03-18 16:32:37 -0500 | [diff] [blame] | 65 | if parse_json: |
| 66 | try: |
| 67 | return json.loads(out_buf) |
Anusha Dathatri | 1e8757a | 2023-09-21 13:02:31 -0500 | [diff] [blame] | 68 | except ValueError as e: |
| 69 | if type(out_buf) is str: |
| 70 | return out_buf |
| 71 | else: |
| 72 | print(str(e)) |
| 73 | return {} |
Rahul Maheshwari | faa5d20 | 2020-02-24 23:32:57 -0600 | [diff] [blame] | 74 | return out_buf |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 75 | |
| 76 | |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 77 | def get_pel_data_from_bmc( |
| 78 | include_hidden_pels=False, include_informational_pels=False |
| 79 | ): |
Sridevi Ramesh | 2930050 | 2022-10-21 02:28:24 -0500 | [diff] [blame] | 80 | r""" |
| 81 | Returns PEL data from BMC else throws exception. |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 82 | |
| 83 | Description of arguments: |
| 84 | include_hidden_pels True/False (default: False). |
| 85 | Set True to get hidden PELs else False. |
| 86 | include_informational_pels True/False (default: False). |
| 87 | Set True to get informational PELs else False. |
Sridevi Ramesh | 2930050 | 2022-10-21 02:28:24 -0500 | [diff] [blame] | 88 | """ |
| 89 | try: |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 90 | pel_cmd = " -l" |
| 91 | if include_hidden_pels: |
| 92 | pel_cmd = pel_cmd + " -h" |
| 93 | if include_informational_pels: |
| 94 | pel_cmd = pel_cmd + " -f" |
| 95 | pel_data = peltool(pel_cmd) |
Sridevi Ramesh | 2930050 | 2022-10-21 02:28:24 -0500 | [diff] [blame] | 96 | if not pel_data: |
| 97 | print("No PEL data present in BMC ...") |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 98 | except Exception as exception: |
| 99 | raise PeltoolException( |
| 100 | "Failed to get PEL data from BMC : " + str(exception) |
| 101 | ) from exception |
Sridevi Ramesh | 2930050 | 2022-10-21 02:28:24 -0500 | [diff] [blame] | 102 | return pel_data |
| 103 | |
| 104 | |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 105 | def verify_no_pel_exists_on_bmc(): |
| 106 | r""" |
| 107 | Verify that no PEL exists in BMC. Raise an exception if it does. |
| 108 | """ |
| 109 | |
| 110 | try: |
| 111 | pel_data = get_pel_data_from_bmc() |
| 112 | |
| 113 | if len(pel_data) == 0: |
| 114 | return True |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 115 | |
| 116 | print("PEL data present. \n", pel_data) |
| 117 | raise PeltoolException("PEL data present in BMC") |
| 118 | except Exception as exception: |
| 119 | raise PeltoolException( |
| 120 | "Failed to get PEL data from BMC : " + str(exception) |
| 121 | ) from exception |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 122 | |
| 123 | |
| 124 | def compare_pel_and_redfish_event_log(pel_record, event_record): |
| 125 | r""" |
| 126 | Compare PEL log attributes like "SRC", "Created at" with Redfish |
| 127 | event log attributes like "EventId", "Created". |
| 128 | Return False if they do not match. |
| 129 | |
| 130 | Description of arguments: |
| 131 | pel_record PEL record. |
| 132 | event_record Redfish event which is equivalent of PEL record. |
| 133 | """ |
| 134 | |
| 135 | try: |
| 136 | # Below is format of PEL record / event record and following |
| 137 | # i.e. "SRC", "Created at" from |
| 138 | # PEL record is compared with "EventId", "Created" from event record. |
| 139 | |
| 140 | # PEL Log attributes |
| 141 | # SRC : XXXXXXXX |
| 142 | # Created at : 11/14/2022 12:38:04 |
| 143 | |
| 144 | # Event log attributes |
| 145 | # EventId : XXXXXXXX XXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX |
| 146 | |
| 147 | # Created : 2022-11-14T12:38:04+00:00 |
| 148 | |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 149 | print(f"\nPEL records : {pel_record}") |
| 150 | print(f"\nEvent records : {event_record}") |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 151 | |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 152 | pel_src = pel_record["pel_data"]["SRC"] |
| 153 | pel_created_time = pel_record["pel_detail_data"]["Private Header"][ |
| 154 | "Created at" |
| 155 | ] |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 156 | |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 157 | event_ids = (event_record["EventId"]).split(" ") |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 158 | |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 159 | event_time_format = (event_record["Created"]).split("T") |
| 160 | event_date = (event_time_format[0]).split("-") |
| 161 | event_date = datetime( |
| 162 | int(event_date[0]), int(event_date[1]), int(event_date[2]) |
| 163 | ) |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 164 | event_date = event_date.strftime("%m/%d/%Y") |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 165 | event_sub_time_format = (event_time_format[1]).split("+") |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 166 | event_date_time = event_date + " " + event_sub_time_format[0] |
| 167 | |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 168 | event_created_time = event_date_time.replace("-", "/") |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 169 | |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 170 | print(f"\nPEL SRC : {pel_src} | PEL Created Time : {pel_created_time}") |
| 171 | |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 172 | print( |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 173 | f"\nError event ID : {event_ids[0]} | Error Log Created Time " |
| 174 | + ": {event_created_time}" |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 175 | ) |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 176 | |
| 177 | if pel_src == event_ids[0] and pel_created_time == event_created_time: |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 178 | print( |
| 179 | "\nPEL SRC and created date time match with " |
| 180 | "event ID, created time" |
| 181 | ) |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 182 | else: |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 183 | raise PeltoolException( |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 184 | "\nPEL SRC and created date time did not " |
| 185 | "match with event ID, created time" |
| 186 | ) |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 187 | except Exception as exception: |
| 188 | raise PeltoolException( |
George Keishing | e16f158 | 2022-12-15 07:32:21 -0600 | [diff] [blame] | 189 | "Exception occurred during PEL and Event log " |
Patrick Williams | b813b55 | 2022-12-12 10:38:46 -0600 | [diff] [blame] | 190 | "comparison for SRC or event ID and created " |
George Keishing | 7899a45 | 2023-02-15 02:46:54 -0600 | [diff] [blame] | 191 | "time : " + str(exception) |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 192 | ) from exception |
Sushil Singh | 28cedb1 | 2022-12-12 01:33:32 -0600 | [diff] [blame] | 193 | |
| 194 | |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 195 | def fetch_all_pel_ids_for_src(src_id, severity, include_hidden_pels=False): |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 196 | r""" |
Sridevi Ramesh | c6dd799 | 2022-02-10 01:06:47 -0600 | [diff] [blame] | 197 | Fetch all PEL IDs for the input SRC ID based on the severity type |
| 198 | in the list format. |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 199 | |
| 200 | Description of arguments: |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 201 | src_id SRC ID (e.g. BCXXYYYY). |
| 202 | severity PEL severity (e.g. "Predictive Error" |
| 203 | "Recovered Error"). |
| 204 | include_hidden_pels True/False (default: False). |
| 205 | Set True to get hidden PELs else False. |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 206 | """ |
| 207 | |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 208 | try: |
Sridevi Ramesh | c6dd799 | 2022-02-10 01:06:47 -0600 | [diff] [blame] | 209 | src_pel_ids = [] |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 210 | pel_data = get_pel_data_from_bmc(include_hidden_pels) |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 211 | pel_id_list = pel_data.keys() |
Sridevi Ramesh | c6dd799 | 2022-02-10 01:06:47 -0600 | [diff] [blame] | 212 | for pel_id in pel_id_list: |
| 213 | # Check if required SRC ID with severity is present |
Sridevi Ramesh | f329997 | 2022-12-18 03:27:22 -0600 | [diff] [blame] | 214 | if src_id in pel_data[pel_id]["SRC"]: |
| 215 | if pel_data[pel_id]["Sev"] == severity: |
| 216 | src_pel_ids.append(pel_id) |
Sridevi Ramesh | c6dd799 | 2022-02-10 01:06:47 -0600 | [diff] [blame] | 217 | |
| 218 | if not src_pel_ids: |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 219 | raise PeltoolException( |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 220 | src_id + " with severity " + severity + " not present" |
| 221 | ) |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 222 | except Exception as exception: |
| 223 | raise PeltoolException( |
| 224 | "Failed to fetch PEL ID for required SRC : " + str(exception) |
| 225 | ) from exception |
Sridevi Ramesh | c6dd799 | 2022-02-10 01:06:47 -0600 | [diff] [blame] | 226 | return src_pel_ids |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 227 | |
| 228 | |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 229 | def fetch_all_src(include_hidden_pels=False): |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 230 | r""" |
Sridevi Ramesh | c6dd799 | 2022-02-10 01:06:47 -0600 | [diff] [blame] | 231 | Fetch all SRC IDs from peltool in the list format. |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 232 | |
| 233 | include_hidden_pels True/False (default: False). |
| 234 | Set True to get hidden PELs else False. |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 235 | """ |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 236 | try: |
Sridevi Ramesh | c6dd799 | 2022-02-10 01:06:47 -0600 | [diff] [blame] | 237 | src_id = [] |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 238 | pel_data = get_pel_data_from_bmc(include_hidden_pels) |
Sridevi Ramesh | c6dd799 | 2022-02-10 01:06:47 -0600 | [diff] [blame] | 239 | if pel_data: |
| 240 | pel_id_list = pel_data.keys() |
| 241 | for pel_id in pel_id_list: |
| 242 | src_id.append(pel_data[pel_id]["SRC"]) |
Sridevi Ramesh | 6bf2363 | 2022-11-25 05:55:38 -0600 | [diff] [blame] | 243 | print("SRC IDs: " + str(src_id)) |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 244 | except Exception as exception: |
| 245 | raise PeltoolException( |
| 246 | "Failed to fetch all SRCs : " + str(exception) |
| 247 | ) from exception |
Sridevi Ramesh | 6e0e091 | 2021-11-16 11:17:37 -0600 | [diff] [blame] | 248 | return src_id |
Sridevi Ramesh | 6bf2363 | 2022-11-25 05:55:38 -0600 | [diff] [blame] | 249 | |
| 250 | |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 251 | def check_for_unexpected_src( |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 252 | unexpected_src_list=None, include_hidden_pels=False |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 253 | ): |
Sridevi Ramesh | 6bf2363 | 2022-11-25 05:55:38 -0600 | [diff] [blame] | 254 | r""" |
| 255 | From the given unexpected SRC list, check if any unexpected SRC created |
| 256 | on the BMC. Returns 0 if no SRC found else throws exception. |
| 257 | |
| 258 | Description of arguments: |
| 259 | unexpected_src_list Give unexpected SRCs in the list format. |
| 260 | e.g.: ["BBXXYYYY", "AAXXYYYY"]. |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 261 | |
| 262 | include_hidden_pels True/False (default: False). |
| 263 | Set True to get hidden PELs else False. |
Sridevi Ramesh | 6bf2363 | 2022-11-25 05:55:38 -0600 | [diff] [blame] | 264 | """ |
| 265 | try: |
| 266 | unexpected_src_count = 0 |
| 267 | if not unexpected_src_list: |
| 268 | print("Unexpected SRC list is empty.") |
Sridevi Ramesh | d1cb325 | 2022-11-28 10:04:05 -0600 | [diff] [blame] | 269 | src_data = fetch_all_src(include_hidden_pels) |
Sridevi Ramesh | 6bf2363 | 2022-11-25 05:55:38 -0600 | [diff] [blame] | 270 | for src in unexpected_src_list: |
| 271 | if src in src_data: |
| 272 | print("Found an unexpected SRC : " + src) |
| 273 | unexpected_src_count = unexpected_src_count + 1 |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 274 | if unexpected_src_count >= 1: |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 275 | raise PeltoolException("Unexpected SRC found.") |
Sridevi Ramesh | 6bf2363 | 2022-11-25 05:55:38 -0600 | [diff] [blame] | 276 | |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 277 | except Exception as exception: |
| 278 | raise PeltoolException( |
| 279 | "Failed to verify unexpected SRC list : " + str(exception) |
| 280 | ) from exception |
Sridevi Ramesh | 6bf2363 | 2022-11-25 05:55:38 -0600 | [diff] [blame] | 281 | return unexpected_src_count |
Anusha Dathatri | e8801a3 | 2022-11-28 04:56:31 -0600 | [diff] [blame] | 282 | |
| 283 | |
| 284 | def filter_unexpected_srcs(expected_srcs=None): |
| 285 | r""" |
| 286 | Return list of SRCs found in BMC after filtering expected SRCs. |
| 287 | If expected_srcs is None then all SRCs found in system are returned. |
| 288 | |
| 289 | Description of arguments: |
| 290 | expected_srcs List of expected SRCs. E.g. ["BBXXYYYY", "AAXXYYYY"]. |
| 291 | """ |
| 292 | |
| 293 | srcs_found = fetch_all_src() |
| 294 | if not expected_srcs: |
| 295 | expected_srcs = [] |
| 296 | print(expected_srcs) |
| 297 | return list(set(srcs_found) - set(expected_srcs)) |
Anusha Dathatri | 5636ad1 | 2022-11-29 04:26:00 -0600 | [diff] [blame] | 298 | |
| 299 | |
| 300 | def get_bmc_event_log_id_for_pel(pel_id): |
| 301 | r""" |
| 302 | Return BMC event log ID for the given PEL ID. |
| 303 | |
| 304 | Description of arguments: |
| 305 | pel_id PEL ID. E.g. 0x50000021. |
| 306 | """ |
| 307 | |
| 308 | pel_data = peltool("-i " + pel_id) |
| 309 | print(pel_data) |
| 310 | bmc_id_for_pel = pel_data["Private Header"]["BMC Event Log Id"] |
| 311 | return bmc_id_for_pel |
Anusha Dathatri | 3914da7 | 2023-02-09 06:01:05 -0600 | [diff] [blame] | 312 | |
| 313 | |
| 314 | def get_latest_pels(number_of_pels=1): |
| 315 | r""" |
| 316 | Return latest PEL IDs. |
| 317 | |
| 318 | Description of arguments: |
| 319 | number_of_pels Number of PELS to be returned. |
| 320 | """ |
| 321 | |
| 322 | pel_data = peltool("-lr") |
| 323 | pel_ids = list(pel_data.keys()) |
| 324 | return pel_ids[:number_of_pels] |