Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
updates widget accordingly
"""
provider._set_lxd_dir_env()
while not self.cancel_monitor.is_set():
try:
client_compatible = await provider.is_client_compatible()
server_compatible = await provider.is_server_compatible()
if client_compatible and server_compatible:
events.LXDAvailable.set()
self.cancel_monitor.set()
cb()
return
except (LocalhostError, LocalhostJSONError, FileNotFoundError):
pass
await run_with_interrupt(asyncio.sleep(2),
self.cancel_monitor)
updates widget accordingly
"""
provider._set_lxd_dir_env()
while not self.cancel_monitor.is_set():
try:
client_compatible = await provider.is_client_compatible()
server_compatible = await provider.is_server_compatible()
if client_compatible and server_compatible:
events.LXDAvailable.set()
self.cancel_monitor.set()
cb()
return
except (LocalhostError, LocalhostJSONError, FileNotFoundError):
pass
await run_with_interrupt(asyncio.sleep(2),
self.cancel_monitor)