From be0ac44c410d7c720a61e21ef56e64c4946df400 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 13 Mar 2024 13:32:59 +0000 Subject: [PATCH] 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 (cherry picked from commit b1d828d1d2f31c02f225bb375d915353582d158a) --- src/ceph-node-proxy/ceph_node_proxy/redfish_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ceph-node-proxy/ceph_node_proxy/redfish_client.py b/src/ceph-node-proxy/ceph_node_proxy/redfish_client.py index 08ee4170dcc6a..d75c3db1e2180 100644 --- a/src/ceph-node-proxy/ceph_node_proxy/redfish_client.py +++ b/src/ceph-node-proxy/ceph_node_proxy/redfish_client.py @@ -43,7 +43,8 @@ class RedFishClient(BaseClient): 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}') -- 2.39.5