Compare commits
2 Commits
b1db6212a0
...
50e8376937
| Author | SHA1 | Date | |
|---|---|---|---|
|
50e8376937
|
|||
|
361e75e4f3
|
@@ -44,7 +44,7 @@ class RedfishSession:
|
||||
"""Container for Redfish session data."""
|
||||
|
||||
token: str | None = None
|
||||
loggout_url: str | None = None
|
||||
logout_url: str | None = None
|
||||
vendor: str | None = None
|
||||
|
||||
|
||||
@@ -63,13 +63,6 @@ class HostConfig:
|
||||
next_retry_time: float = field(default=0.0, init=False)
|
||||
session: RedfishSession = field(default_factory=RedfishSession)
|
||||
|
||||
# New attributes for Redfish stuff
|
||||
vendor: str | None = None
|
||||
session_token: str | None = None
|
||||
session_logout: str | None = (
|
||||
None # SessionLocation like /redfish/v1/SessionService/Sessions/marco.lucarelli%40abacus.ch00000000xxx/
|
||||
)
|
||||
|
||||
def should_skip(self) -> bool:
|
||||
"""Check if host is still in cool-down window"""
|
||||
return time.monotonic() < self.next_retry_time
|
||||
@@ -633,7 +626,7 @@ async def run_exporter(config, stop_event):
|
||||
# Graceful shutdown: logout from Redfish sessions
|
||||
logging.info("Exporter stopping, logging out from Redfish sessions...")
|
||||
await asyncio.gather(
|
||||
*(logout_host(session, h) for h in host_objs if h.session_token)
|
||||
*(logout_host(session, h) for h in host_objs if h.session.token)
|
||||
)
|
||||
logging.info("All sessions logged out.")
|
||||
logging.info("Exporter stopped cleanly.")
|
||||
|
||||
Reference in New Issue
Block a user