Fix bmcDumpList function output
This patch provides a fix for the dump list command to only return dump
entries instead of including the manager and other various endpoints
which could break calling functions. Now only numerically numbered
entries are returned.
Signed-off-by: Justin Thaler <thalerj@us.ibm.com>
Change-Id: I6051c46f69b45d6b262fc84ef2aa5dc62a46611b
diff --git a/thalerj/openbmctool.py b/thalerj/openbmctool.py
index 512ef7f..ef5c69a 100755
--- a/thalerj/openbmctool.py
+++ b/thalerj/openbmctool.py
@@ -1616,6 +1616,14 @@
try:
r = session.get(url, headers=jsonHeader, verify=False, timeout=baseTimeout)
dumpList = r.json()
+ formattedList = []
+ #remove items that aren't dump entries 'entry, internal, manager endpoints'
+ if 'data' in dumpList:
+ for entry in dumpList['data']:
+ if 'entry' in entry:
+ if entry.split('/')[-1].isnumeric():
+ formattedList.append(entry)
+ dumpList['data']= formattedList
return dumpList
except(requests.exceptions.Timeout):
return connectionErrHandler(args.json, "Timeout", None)