From 527a718814d7c61d586627f22d47768288c926f8 Mon Sep 17 00:00:00 2001 From: Kevin_Zheng Date: Fri, 23 Dec 2016 17:18:23 +0800 Subject: [PATCH] Typo Fix Trivial Fix some typos in Zun Change-Id: Iddca6783ce08bcceec7ccc503541d3c0b633d9ce --- nova/virt/docker/driver.py | 4 +-- specs/container-interactive-mode.rst | 2 +- zun/compute/manager.py | 36 +++++++++++++------------- zun/image/driver.py | 4 +-- zun/image/glance/driver.py | 2 +- zun/tests/tempest/api/test_services.py | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/nova/virt/docker/driver.py b/nova/virt/docker/driver.py index 3be1e0600..ceeaaf8ea 100644 --- a/nova/virt/docker/driver.py +++ b/nova/virt/docker/driver.py @@ -264,7 +264,7 @@ class DockerDriver(driver.ComputeDriver): mem = container['Config'].get('Memory', 0) # 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 # FIXME(ewindisch): Improve use of statistics: @@ -332,7 +332,7 @@ class DockerDriver(driver.ComputeDriver): n = 0 while True: # 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 # machine, we allow 10 seconds as a hard limit. if n > 20: diff --git a/specs/container-interactive-mode.rst b/specs/container-interactive-mode.rst index 325a8ecb5..fdaf9ecd0 100644 --- a/specs/container-interactive-mode.rst +++ b/specs/container-interactive-mode.rst @@ -44,7 +44,7 @@ Proposed change 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 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. 3. Zun api will wait for the container start and get the websocket link to zun CLIs. diff --git a/zun/compute/manager.py b/zun/compute/manager.py index dd2007390..2c126cee3 100644 --- a/zun/compute/manager.py +++ b/zun/compute/manager.py @@ -77,7 +77,7 @@ class Manager(object): try: self.driver.delete_sandbox(context, sandbox_id) 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)) def _do_container_create(self, context, container, reraise=False): @@ -117,7 +117,7 @@ class Manager(object): except exception.DockerError as e: with excutils.save_and_reraise_exception(reraise=reraise): LOG.error(_LE( - "Error occured while calling docker image API: %s"), + "Error occurred while calling docker image API: %s"), six.text_type(e)) self._do_sandbox_cleanup(context, sandbox_id) self._fail_container(container, six.text_type(e)) @@ -142,7 +142,7 @@ class Manager(object): except exception.DockerError as e: with excutils.save_and_reraise_exception(reraise=reraise): LOG.error(_LE( - "Error occured while calling docker create API: %s"), + "Error occurred while calling docker create API: %s"), six.text_type(e)) self._do_sandbox_cleanup(context, sandbox_id) self._fail_container(container, six.text_type(e)) @@ -165,7 +165,7 @@ class Manager(object): container.save() return container 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)) self._fail_container(container, six.text_type(e)) raise @@ -183,8 +183,8 @@ class Manager(object): self._validate_container_state(container, 'delete') self.driver.delete(container, force) except exception.DockerError as e: - LOG.error(_LE("Error occured while calling docker delete API: %s"), - six.text_type(e)) + LOG.error(_LE("Error occurred while calling docker " + "delete API: %s"), six.text_type(e)) raise except Exception as e: LOG.exception(_LE("Unexpected exception: %s"), str(e)) @@ -206,7 +206,7 @@ class Manager(object): try: return self.driver.list() 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)) raise except Exception as e: @@ -221,7 +221,7 @@ class Manager(object): container.save() return container 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)) raise except Exception as e: @@ -237,8 +237,8 @@ class Manager(object): container.save() return container except exception.DockerError as e: - LOG.error(_LE("Error occured while calling docker reboot API: %s"), - six.text_type(e)) + LOG.error(_LE("Error occurred while calling docker reboot " + "API: %s"), six.text_type(e)) raise except Exception as e: LOG.exception(_LE("Unexpected exception: %s"), str(e)) @@ -253,7 +253,7 @@ class Manager(object): container.save() return container 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)) raise except Exception as e: @@ -273,7 +273,7 @@ class Manager(object): container.save() return container 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)) raise except Exception as e: @@ -289,7 +289,7 @@ class Manager(object): container.save() return container 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"), six.text_type(e)) raise @@ -303,7 +303,7 @@ class Manager(object): try: return self.driver.show_logs(container) 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)) raise except Exception as e: @@ -317,7 +317,7 @@ class Manager(object): try: return self.driver.execute(container, command) 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)) raise except Exception as e: @@ -333,7 +333,7 @@ class Manager(object): container.save() return container 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)) raise @@ -355,7 +355,7 @@ class Manager(object): LOG.error(six.text_type(e)) return 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)) raise e except Exception as e: @@ -378,7 +378,7 @@ class Manager(object): try: return self.driver.get_addresses(context, container) 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)) raise except Exception as e: diff --git a/zun/image/driver.py b/zun/image/driver.py index 0b8363760..5254a5ab7 100644 --- a/zun/image/driver.py +++ b/zun/image/driver.py @@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__) 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 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: image = None except Exception as e: - LOG.exception(_LE('Unknown exception occured while loading' + LOG.exception(_LE('Unknown exception occurred while loading' ' image : %s'), str(e)) raise exception.ZunException(str(e)) if not image: diff --git a/zun/image/glance/driver.py b/zun/image/glance/driver.py index beaa03de6..ecd1b5858 100644 --- a/zun/image/glance/driver.py +++ b/zun/image/glance/driver.py @@ -86,7 +86,7 @@ class GlanceDriver(driver.ContainerImageDriver): for chunk in image_chunks: fd.write(chunk) except Exception as e: - msg = _('Error occured while writing image: {0}') + msg = _('Error occurred while writing image: {0}') raise exception.ZunException(msg.format(e)) LOG.debug('Image %s was downloaded to path : %s' % (repo, out_path)) diff --git a/zun/tests/tempest/api/test_services.py b/zun/tests/tempest/api/test_services.py index cc605f545..c83824eae 100644 --- a/zun/tests/tempest/api/test_services.py +++ b/zun/tests/tempest/api/test_services.py @@ -41,7 +41,7 @@ class TestService(base.BaseZunTest): 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 # implementing policy in functional tests @decorators.idempotent_id('a04f61f2-15ae-4200-83b7-1f311b101f36')