Skip to content

Commit b1d828d

Browse files
committed
node-proxy: fix RedFishClient.logout() method
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 <[email protected]>
1 parent 6185d08 commit b1d828d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ceph-node-proxy/ceph_node_proxy/redfish_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def login(self) -> None:
4343
self.log.error(msg)
4444
raise RuntimeError
4545
self.token = _headers['X-Auth-Token']
46-
self.location = _headers['Location']
46+
location_endpoint: str = _headers['Location'].split('/', 3)[-1:][0]
47+
self.location = f'/{location_endpoint}'
4748

4849
def is_logged_in(self) -> bool:
4950
self.log.debug(f'Checking token validity for {self.url}')

0 commit comments

Comments
 (0)