Merge "Fix some errors and warnings"
This commit is contained in:
commit
0dd99de122
|
@ -62,6 +62,7 @@ class ContainerCollection(collection.Collection):
|
|||
"""A list containing containers objects"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(ContainerCollection, self).__init__(**kwargs)
|
||||
self._type = 'containers'
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -21,6 +21,7 @@ from zun.api.controllers.v1.schemas import images as schema
|
|||
from zun.api.controllers.v1.views import images_view as view
|
||||
from zun.api import utils as api_utils
|
||||
from zun.common import exception
|
||||
from zun.common.i18n import _
|
||||
from zun.common import policy
|
||||
from zun.common import utils
|
||||
from zun.common import validation
|
||||
|
@ -40,6 +41,7 @@ class ImageCollection(collection.Collection):
|
|||
"""A list containing images objects"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(ImageCollection, self).__init__(**kwargs)
|
||||
self._type = 'images'
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -77,14 +77,14 @@ class API(object):
|
|||
def container_stop(self, context, container, *args):
|
||||
return self.rpcapi.container_stop(context, container, *args)
|
||||
|
||||
def container_start(self, context, container, *args):
|
||||
return self.rpcapi.container_start(context, container, *args)
|
||||
def container_start(self, context, container):
|
||||
return self.rpcapi.container_start(context, container)
|
||||
|
||||
def container_pause(self, context, container, *args):
|
||||
return self.rpcapi.container_pause(context, container, *args)
|
||||
def container_pause(self, context, container):
|
||||
return self.rpcapi.container_pause(context, container)
|
||||
|
||||
def container_unpause(self, context, container, *args):
|
||||
return self.rpcapi.container_unpause(context, container, *args)
|
||||
def container_unpause(self, context, container):
|
||||
return self.rpcapi.container_unpause(context, container)
|
||||
|
||||
def container_logs(self, context, container, stdout, stderr,
|
||||
timestamps, tail, since):
|
||||
|
@ -127,8 +127,8 @@ class API(object):
|
|||
def container_commit(self, context, container, *args):
|
||||
return self.rpcapi.container_commit(context, container, *args)
|
||||
|
||||
def image_pull(self, context, image, *args):
|
||||
return self.rpcapi.image_pull(context, image, *args)
|
||||
def image_pull(self, context, image):
|
||||
return self.rpcapi.image_pull(context, image)
|
||||
|
||||
def image_search(self, context, image, image_driver, *args):
|
||||
return self.rpcapi.image_search(context, image, image_driver, *args)
|
||||
|
|
|
@ -95,7 +95,7 @@ def search_image(context, image_name, image_driver, exact_match):
|
|||
try:
|
||||
image_driver = load_image_driver(driver)
|
||||
imgs = image_driver.search_image(context, repo, tag,
|
||||
exact_match=exact_match)
|
||||
exact_match)
|
||||
images.extend(imgs)
|
||||
except Exception as e:
|
||||
LOG.exception(('Unknown exception occurred while searching '
|
||||
|
@ -138,11 +138,11 @@ def upload_image_data(context, image, image_tag, image_data,
|
|||
class ContainerImageDriver(object):
|
||||
"""Base class for container image driver."""
|
||||
|
||||
def pull_image(self, context, repo, tag):
|
||||
def pull_image(self, context, repo, tag, image_pull_policy):
|
||||
"""Pull an image."""
|
||||
raise NotImplementedError()
|
||||
|
||||
def search_image(self, context, repo, tag):
|
||||
def search_image(self, context, repo, tag, exact_match):
|
||||
"""Search an image."""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class Scheduler(object):
|
|||
if self.servicegroup_api.service_is_up(service)]
|
||||
|
||||
@abc.abstractmethod
|
||||
def select_destinations(self, context, containers):
|
||||
def select_destinations(self, context, containers, extra_spec):
|
||||
"""Must override select_destinations method.
|
||||
|
||||
:return: A list of dicts with 'host', 'nodename' and 'limits' as keys
|
||||
|
|
|
@ -32,8 +32,8 @@ CONF = zun.conf.CONF
|
|||
class FilterScheduler(driver.Scheduler):
|
||||
"""Scheduler that can be used for filtering zun compute."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(FilterScheduler, self).__init__(*args, **kwargs)
|
||||
def __init__(self):
|
||||
super(FilterScheduler, self).__init__()
|
||||
self.filter_handler = filters.HostFilterHandler()
|
||||
filter_classes = self.filter_handler.get_matching_classes(
|
||||
CONF.scheduler.available_filters)
|
||||
|
|
|
@ -56,7 +56,6 @@ class TestRootController(api_base.FunctionalTest):
|
|||
u'rel': u'self'},
|
||||
{u'href': u'http://localhost/containers/',
|
||||
u'rel': u'bookmark'}],
|
||||
u'id': u'v1',
|
||||
u'images': [{u'href': u'http://localhost/v1/images/',
|
||||
u'rel': u'self'},
|
||||
{u'href': u'http://localhost/images/',
|
||||
|
|
Loading…
Reference in New Issue