Skip to content

Commit 14f35cd

Browse files
authored
Merge pull request #166 from DMTF/Fix165-Auth-ServiceRoot-Workaround
Added workaround for services incorrectly responding with 401 when accessing the service root
2 parents a7e7f62 + 905594b commit 14f35cd

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)