How to use the cobald.daemon.runtime._meta_runner.runners function in cobald

To help you get started, we’ve selected a few cobald 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 MatterMiners / tardis / tardis / adapters / sites / cloudstack.py View on Github external
def __init__(self, machine_type: str, site_name: str):
        self._configuration = getattr(Configuration(), site_name)
        self.cloud_stack_client = CloudStack(
            end_point=self._configuration.end_point,
            api_key=self._configuration.api_key,
            api_secret=self._configuration.api_secret,
            event_loop=runtime._meta_runner.runners[asyncio].event_loop,
        )
        self._machine_type = machine_type
        self._site_name = site_name

        key_translator = StaticMapping(
            remote_resource_uuid="id", drone_uuid="name", resource_status="state"
        )

        translator_functions = StaticMapping(
            created=lambda date: datetime.strptime(date, "%Y-%m-%dT%H:%M:%S%z"),
            updated=lambda date: datetime.strptime(date, "%Y-%m-%dT%H:%M:%S%z"),
            state=lambda x, translator=StaticMapping(
                Present=ResourceStatus.Booting,
                Running=ResourceStatus.Running,
                Stopped=ResourceStatus.Stopped,
                Expunged=ResourceStatus.Deleted,