How to use the juju.utils.run_with_interrupt function in juju

To help you get started, we’ve selected a few juju examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github conjure-up / conjure-up / conjureup / controllers / clouds / gui.py View on Github external
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)
github conjure-up / conjure-up / conjureup / controllers / clouds / gui.py View on Github external
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)