From: Guillaume Abrioux Date: Thu, 11 May 2023 11:29:05 +0000 (+0200) Subject: node-proxy: display error messages when Exception is caught X-Git-Tag: testing/wip-pdonnell-testing-20240430.123648-reef-debug~291^2~107 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a7efe2f52dce06e3516cb98f33179acfee95dbfe;p=ceph-ci.git node-proxy: display error messages when Exception is caught This is mostly for development purposes. Signed-off-by: Guillaume Abrioux (cherry picked from commit 4b9a4ec55fbcbeed48b1dc01594cf8ed65a23ef5) --- diff --git a/src/cephadm/node-proxy/redfish_client.py b/src/cephadm/node-proxy/redfish_client.py index 8b85daeace3..52ae3c089de 100644 --- a/src/cephadm/node-proxy/redfish_client.py +++ b/src/cephadm/node-proxy/redfish_client.py @@ -35,6 +35,7 @@ class RedFishClient: return response.dict except Exception as e: #TODO + log.error(f"Error detected.\n{e}") pass def logout(self): diff --git a/src/cephadm/node-proxy/redfish_system.py b/src/cephadm/node-proxy/redfish_system.py index ae02062a469..6dd457774d9 100644 --- a/src/cephadm/node-proxy/redfish_system.py +++ b/src/cephadm/node-proxy/redfish_system.py @@ -95,7 +95,7 @@ class RedfishSystem(System): self._update_storage() sleep(3) # Catching 'Exception' is probably not a good idea (devel only) - except Exception: - log.error(f"Error detected, logging out from redfish api") + except Exception as e: + log.error(f"Error detected, logging out from redfish api.\n{e}") self.client.logout() raise