PEL: Get unexpected SRCs in BMC
Changes:
- Added a method to filter and return the unexpected SRCs in BMC
Tested:
- Created a keyword and tested it.
Signed-off-by: Anusha Dathatri <adathatr@in.ibm.com>
Change-Id: I90f9e7061e0c4a282f5788ae077f44e5b8617f74
diff --git a/lib/pel_utils.py b/lib/pel_utils.py
index 665ac42..a60606a 100644
--- a/lib/pel_utils.py
+++ b/lib/pel_utils.py
@@ -208,3 +208,19 @@
except Exception as e:
raise peltool_exception("Failed to verify unexpected SRC list : " + str(e))
return unexpected_src_count
+
+
+def filter_unexpected_srcs(expected_srcs=None):
+ r"""
+ Return list of SRCs found in BMC after filtering expected SRCs.
+ If expected_srcs is None then all SRCs found in system are returned.
+
+ Description of arguments:
+ expected_srcs List of expected SRCs. E.g. ["BBXXYYYY", "AAXXYYYY"].
+ """
+
+ srcs_found = fetch_all_src()
+ if not expected_srcs:
+ expected_srcs = []
+ print(expected_srcs)
+ return list(set(srcs_found) - set(expected_srcs))