Suppress /redfish/v1/ logging on console
It does not require authentication to access
/redfish/v1/ URI and start of the test is
dumping 3 entries at the beginning which is excessive.
There has been a request earlier from community
as well on this.
Changes:
Restful request args[0] position is always the
URI for redfish request. Skip logging /redfish/v1/
Tested:
Ran from sandbox with the changes
Change-Id: I30fe85c1d3c926dcc60ffc6fe5b629fbd4cfcbab
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/redfish_plus.py b/lib/redfish_plus.py
index 3630cc1..d6e1cb0 100755
--- a/lib/redfish_plus.py
+++ b/lib/redfish_plus.py
@@ -111,7 +111,6 @@
Timeout for GET/POST/PATCH/DELETE operations. By default 30 seconds, else user defined value.
Similarly, Max retry by default 10 attempt for the operation, else user defined value.
"""
- gp.qprint_executing(stack_frame_ix=3, style=gp.func_line_style_short)
# Convert python string object definitions to objects (mostly useful for robot callers).
args = fa.args_to_objects(args)
kwargs = fa.args_to_objects(kwargs)
@@ -121,6 +120,18 @@
self._max_retry = max_retry
valid_status_codes = kwargs.pop("valid_status_codes", [200])
+ # /redfish/v1/ does not require authentication and start of the test
+ # is dumping 3 entries at the beginning which is excessive.
+ # args[0] position is always the URI for redfish request
+ # Example:
+ # ('/redfish/v1/',)
+ # ('/redfish/v1/Managers/bmc',)
+ # Skip logging if matches /redfish/v1/
+ if args[0] != "/redfish/v1/":
+ gp.qprint_executing(
+ stack_frame_ix=3, style=gp.func_line_style_short
+ )
+
try:
response = func(*args, **kwargs)
except Exception as e: