MCPcopy Create free account
hub / github.com/ceph/ceph / main

Method main

src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py:142–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

140 )
141
142 def main(self) -> None:
143 self.stop = False
144 self.client.login()
145 self.endpoints.init()
146
147 while not self.stop:
148 self.log.debug("waiting for a lock in the update loop.")
149 with self.lock:
150 if not self.pending_shutdown:
151 self.log.debug("lock acquired in the update loop.")
152 try:
153 self._update_system()
154 self._update_sn()
155
156 with concurrent.futures.ThreadPoolExecutor() as executor:
157 executor.map(lambda f: f(), self.update_funcs)
158
159 self.data_ready = True
160 except RuntimeError as e:
161 self.stop = True
162 self.log.error(
163 f"Error detected, trying to gracefully log out from redfish api.\n{e}"
164 )
165 self.client.logout()
166 raise
167 sleep(self.refresh_interval)
168 self.log.debug("lock released in the update loop.")
169 self.log.debug("exiting update loop.")
170 raise SystemExit(0)
171
172 def flush(self) -> None:
173 self.log.debug("Acquiring lock to flush data.")

Callers

nothing calls this directly

Calls 9

_update_systemMethod · 0.95
_update_snMethod · 0.95
fFunction · 0.85
loginMethod · 0.65
initMethod · 0.45
debugMethod · 0.45
mapMethod · 0.45
errorMethod · 0.45
logoutMethod · 0.45

Tested by

no test coverage detected