Skip to content

Commit 905594b

Browse files
committed
Added workaround for services incorrectly responding with 401 when accessing the service root
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
1 parent a7e7f62 commit 905594b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/redfish/rest/v1.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,13 @@ def get_root_object(self):
596596
except Exception as excp:
597597
raise excp
598598

599+
if resp.status == 401 and self.__authorization_key is None and self.__session_key is None:
600+
# Workaround where the service incorrectly rejects access to service
601+
# root when no credentials are provided
602+
warnings.warn("Service incorrectly responded with HTTP 401 Unauthorized for the service root. Contact your vendor.")
603+
self.root = {}
604+
self.root_resp = resp
605+
return
599606
if resp.status != 200:
600607
raise ServerDownOrUnreachableError("Server not reachable, " \
601608
"return code: %d" % resp.status,response=resp)

0 commit comments

Comments
 (0)