]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
node-proxy: (Redfish_System) reuse the existing client when possible
authorGuillaume Abrioux <gabrioux@ibm.com>
Thu, 15 Jun 2023 14:20:31 +0000 (16:20 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 14:51:41 +0000 (14:51 +0000)
Otherwise, the method start_client() recreates a new client.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit ee1d4e49d1431365ceed4043a59d9f91123c4506)

src/cephadm/node-proxy/redfish_system.py

index 7254236938a119b49d40f1c7762ebbc4c99913dd..ffa530cefbf06a91ce160139db29568b505761c9 100644 (file)
@@ -35,7 +35,8 @@ class RedfishSystem(System):
         return result
 
     def start_client(self) -> None:
-        self.client = RedFishClient(self.host, self.username, self.password)
+        if not self.client:
+            self.client = RedFishClient(self.host, self.username, self.password)
         self.client.login()
 
     def get_system(self) -> Dict[str, Dict[str, Dict]]: