the endpoint passed down to util.query() is wrong:
is passes the full url (scheme://addr:port/path) where it should only
pass the path. The cause is that RedFishClient.login() basically stores
the value of the Location header in `self.location`.
The consequence of this is that it makes the client unable to properly logout.
Fixes: https://tracker.ceph.com/issues/64894
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
self.log.error(msg)
raise RuntimeError
self.token = _headers['X-Auth-Token']
- self.location = _headers['Location']
+ location_endpoint: str = _headers['Location'].split('/', 3)[-1:][0]
+ self.location = f'/{location_endpoint}'
def is_logged_in(self) -> bool:
self.log.debug(f'Checking token validity for {self.url}')