Trivial Fix some typos in Zun

Change-Id: Iddca6783ce08bcceec7ccc503541d3c0b633d9ce
This commit is contained in:
Kevin_Zheng 2016-12-23 17:18:23 +08:00
parent 46badb8ed8
commit 527a718814
6 changed files with 25 additions and 25 deletions

View File

@ -264,7 +264,7 @@ class DockerDriver(driver.ComputeDriver):
mem = container['Config'].get('Memory', 0) mem = container['Config'].get('Memory', 0)
# NOTE(ewindisch): cgroups/lxc defaults to 1024 multiplier. # NOTE(ewindisch): cgroups/lxc defaults to 1024 multiplier.
# see: _get_cpu_shares for further explaination # see: _get_cpu_shares for further explanation
num_cpu = container['Config'].get('CpuShares', 0) / 1024 num_cpu = container['Config'].get('CpuShares', 0) / 1024
# FIXME(ewindisch): Improve use of statistics: # FIXME(ewindisch): Improve use of statistics:
@ -332,7 +332,7 @@ class DockerDriver(driver.ComputeDriver):
n = 0 n = 0
while True: while True:
# NOTE(samalba): We wait for the process to be spawned inside the # NOTE(samalba): We wait for the process to be spawned inside the
# container in order to get the the "container pid". This is # container in order to get the "container pid". This is
# usually really fast. To avoid race conditions on a slow # usually really fast. To avoid race conditions on a slow
# machine, we allow 10 seconds as a hard limit. # machine, we allow 10 seconds as a hard limit.
if n > 20: if n > 20:

View File

@ -44,7 +44,7 @@ Proposed change
1. Let each Docker daemon listens to 0.0.0.0:port, so that zun-api will easily 1. Let each Docker daemon listens to 0.0.0.0:port, so that zun-api will easily
talk with Docker deamon. This might reduce the load on zun-compute a bit talk with Docker deamon. This might reduce the load on zun-compute a bit
and let zun-compute have more rooms to serve other workload. and let zun-compute have more rooms to serve other workload.
2. For docker daemon, the new two paramaters about tty and stdin_open should 2. For docker daemon, the new two parameters about tty and stdin_open should
be added to the container field and corresponding database. be added to the container field and corresponding database.
3. Zun api will wait for the container start and get the websocket link to zun 3. Zun api will wait for the container start and get the websocket link to zun
CLIs. CLIs.

View File

@ -77,7 +77,7 @@ class Manager(object):
try: try:
self.driver.delete_sandbox(context, sandbox_id) self.driver.delete_sandbox(context, sandbox_id)
except Exception as e: except Exception as e:
LOG.error(_LE("Error occured while deleting sandbox: %s"), LOG.error(_LE("Error occurred while deleting sandbox: %s"),
six.text_type(e)) six.text_type(e))
def _do_container_create(self, context, container, reraise=False): def _do_container_create(self, context, container, reraise=False):
@ -117,7 +117,7 @@ class Manager(object):
except exception.DockerError as e: except exception.DockerError as e:
with excutils.save_and_reraise_exception(reraise=reraise): with excutils.save_and_reraise_exception(reraise=reraise):
LOG.error(_LE( LOG.error(_LE(
"Error occured while calling docker image API: %s"), "Error occurred while calling docker image API: %s"),
six.text_type(e)) six.text_type(e))
self._do_sandbox_cleanup(context, sandbox_id) self._do_sandbox_cleanup(context, sandbox_id)
self._fail_container(container, six.text_type(e)) self._fail_container(container, six.text_type(e))
@ -142,7 +142,7 @@ class Manager(object):
except exception.DockerError as e: except exception.DockerError as e:
with excutils.save_and_reraise_exception(reraise=reraise): with excutils.save_and_reraise_exception(reraise=reraise):
LOG.error(_LE( LOG.error(_LE(
"Error occured while calling docker create API: %s"), "Error occurred while calling docker create API: %s"),
six.text_type(e)) six.text_type(e))
self._do_sandbox_cleanup(context, sandbox_id) self._do_sandbox_cleanup(context, sandbox_id)
self._fail_container(container, six.text_type(e)) self._fail_container(container, six.text_type(e))
@ -165,7 +165,7 @@ class Manager(object):
container.save() container.save()
return container return container
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker start API: %s"), LOG.error(_LE("Error occurred while calling docker start API: %s"),
six.text_type(e)) six.text_type(e))
self._fail_container(container, six.text_type(e)) self._fail_container(container, six.text_type(e))
raise raise
@ -183,8 +183,8 @@ class Manager(object):
self._validate_container_state(container, 'delete') self._validate_container_state(container, 'delete')
self.driver.delete(container, force) self.driver.delete(container, force)
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker delete API: %s"), LOG.error(_LE("Error occurred while calling docker "
six.text_type(e)) "delete API: %s"), six.text_type(e))
raise raise
except Exception as e: except Exception as e:
LOG.exception(_LE("Unexpected exception: %s"), str(e)) LOG.exception(_LE("Unexpected exception: %s"), str(e))
@ -206,7 +206,7 @@ class Manager(object):
try: try:
return self.driver.list() return self.driver.list()
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker list API: %s"), LOG.error(_LE("Error occurred while calling docker list API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
except Exception as e: except Exception as e:
@ -221,7 +221,7 @@ class Manager(object):
container.save() container.save()
return container return container
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker show API: %s"), LOG.error(_LE("Error occurred while calling docker show API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
except Exception as e: except Exception as e:
@ -237,8 +237,8 @@ class Manager(object):
container.save() container.save()
return container return container
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker reboot API: %s"), LOG.error(_LE("Error occurred while calling docker reboot "
six.text_type(e)) "API: %s"), six.text_type(e))
raise raise
except Exception as e: except Exception as e:
LOG.exception(_LE("Unexpected exception: %s"), str(e)) LOG.exception(_LE("Unexpected exception: %s"), str(e))
@ -253,7 +253,7 @@ class Manager(object):
container.save() container.save()
return container return container
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker stop API: %s"), LOG.error(_LE("Error occurred while calling docker stop API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
except Exception as e: except Exception as e:
@ -273,7 +273,7 @@ class Manager(object):
container.save() container.save()
return container return container
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker pause API: %s"), LOG.error(_LE("Error occurred while calling docker pause API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
except Exception as e: except Exception as e:
@ -289,7 +289,7 @@ class Manager(object):
container.save() container.save()
return container return container
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker unpause " LOG.error(_LE("Error occurred while calling docker unpause "
"API: %s"), "API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
@ -303,7 +303,7 @@ class Manager(object):
try: try:
return self.driver.show_logs(container) return self.driver.show_logs(container)
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker logs API: %s"), LOG.error(_LE("Error occurred while calling docker logs API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
except Exception as e: except Exception as e:
@ -317,7 +317,7 @@ class Manager(object):
try: try:
return self.driver.execute(container, command) return self.driver.execute(container, command)
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker exec API: %s"), LOG.error(_LE("Error occurred while calling docker exec API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
except Exception as e: except Exception as e:
@ -333,7 +333,7 @@ class Manager(object):
container.save() container.save()
return container return container
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker kill API: %s"), LOG.error(_LE("Error occurred while calling docker kill API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
@ -355,7 +355,7 @@ class Manager(object):
LOG.error(six.text_type(e)) LOG.error(six.text_type(e))
return return
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker image API: %s"), LOG.error(_LE("Error occurred while calling docker image API: %s"),
six.text_type(e)) six.text_type(e))
raise e raise e
except Exception as e: except Exception as e:
@ -378,7 +378,7 @@ class Manager(object):
try: try:
return self.driver.get_addresses(context, container) return self.driver.get_addresses(context, container)
except exception.DockerError as e: except exception.DockerError as e:
LOG.error(_LE("Error occured while calling docker API: %s"), LOG.error(_LE("Error occurred while calling docker API: %s"),
six.text_type(e)) six.text_type(e))
raise raise
except Exception as e: except Exception as e:

View File

@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__)
def load_image_driver(image_driver=None): def load_image_driver(image_driver=None):
"""Load a image driver module. """Load an image driver module.
Load the container image driver module specified by the image_driver Load the container image driver module specified by the image_driver
configuration option or, if supplied, the driver name supplied as an configuration option or, if supplied, the driver name supplied as an
@ -67,7 +67,7 @@ def pull_image(context, repo, tag, image_pull_policy):
except exception.ImageNotFound: except exception.ImageNotFound:
image = None image = None
except Exception as e: except Exception as e:
LOG.exception(_LE('Unknown exception occured while loading' LOG.exception(_LE('Unknown exception occurred while loading'
' image : %s'), str(e)) ' image : %s'), str(e))
raise exception.ZunException(str(e)) raise exception.ZunException(str(e))
if not image: if not image:

View File

@ -86,7 +86,7 @@ class GlanceDriver(driver.ContainerImageDriver):
for chunk in image_chunks: for chunk in image_chunks:
fd.write(chunk) fd.write(chunk)
except Exception as e: except Exception as e:
msg = _('Error occured while writing image: {0}') msg = _('Error occurred while writing image: {0}')
raise exception.ZunException(msg.format(e)) raise exception.ZunException(msg.format(e))
LOG.debug('Image %s was downloaded to path : %s' LOG.debug('Image %s was downloaded to path : %s'
% (repo, out_path)) % (repo, out_path))

View File

@ -41,7 +41,7 @@ class TestService(base.BaseZunTest):
super(TestService, cls).resource_setup() super(TestService, cls).resource_setup()
# TODO(pksingh): currently functional test doesnt support # TODO(pksingh): currently functional test doesn't support
# policy, will write another test after # policy, will write another test after
# implementing policy in functional tests # implementing policy in functional tests
@decorators.idempotent_id('a04f61f2-15ae-4200-83b7-1f311b101f36') @decorators.idempotent_id('a04f61f2-15ae-4200-83b7-1f311b101f36')