Commit 65976d37 authored by Daniele Venzano's avatar Daniele Venzano

Fix pylint warnings

parent 42234400
......@@ -59,8 +59,8 @@ class DockerEngineBackend(zoe_master.backends.base.BaseBackend):
def spawn_service(self, service_instance: ServiceInstance):
"""Spawn a service, translating a Zoe Service into a Docker container."""
m = re.search(r'^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$', service_instance.image_name)
if m.group(4) is None:
parsed_name = re.search(r'^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$', service_instance.image_name)
if parsed_name.group(4) is None:
raise ZoeStartExecutionFatalException('Image {} does not have a version tag'.format(service_instance.image_name))
conf = self._get_config(service_instance.backend_host)
try:
......@@ -91,8 +91,8 @@ class DockerEngineBackend(zoe_master.backends.base.BaseBackend):
def preload_image(self, image_name):
"""Pull an image from a Docker registry into each host. We shuffle the list to prevent the scheduler to find always the first host in the list."""
m = re.search(r'^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$', image_name)
if m.group(4) is None:
parsed_name = re.search(r'^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$', image_name)
if parsed_name.group(4) is None:
raise ZoeException('Image {} does not have a version tag'.format(image_name))
one_success = False
for host_conf in self.docker_config:
......
......@@ -16,8 +16,8 @@
"""The high-level interface that Zoe uses to talk to the configured container backend."""
import logging
from typing import List
import time
from typing import List
from zoe_lib.config import get_conf
from zoe_lib.state import Execution, Service, SQLManager # pylint: disable=unused-import
......
......@@ -74,3 +74,7 @@ class KubernetesBackend(zoe_master.backends.base.BaseBackend):
node.memory_in_use = node.memory_reserved
node.cores_in_use = node.cores_reserved
return info
def preload_image(self, image_name: str) -> None:
"""Make a service image available."""
raise NotImplementedError
......@@ -75,3 +75,7 @@ class SwarmBackend(zoe_master.backends.base.BaseBackend):
def service_log(self, service: Service):
"""Get the log."""
return self.swarm.logs(service.backend_id, True, False)
def preload_image(self, image_name: str) -> None:
"""Make a service image available."""
raise NotImplementedError
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment