From 2e0d1f41ec01b15076f9ba78036d4e90d3de2474 Mon Sep 17 00:00:00 2001 From: Zhiteng Huang Date: Tue, 3 Dec 2013 22:49:12 +0800 Subject: [PATCH] Fix typo/misspelled words Fix type/misspelled words found by this handy tools: https://github.com/lyda/misspell-check Some 'typo's were intentional since they are part of function name, so they are left alone. Change-Id: I4badda869521659b541d018727a6f71f518e2ee0 --- cinder/brick/initiator/connector.py | 2 +- cinder/taskflow/utils.py | 2 +- cinder/tests/api/contrib/test_services.py | 4 ++-- cinder/tests/api/test_router.py | 8 ++++---- cinder/tests/api/v1/test_limits.py | 2 +- cinder/tests/api/v2/test_limits.py | 2 +- cinder/tests/test_huawei_hvs.py | 16 ++++++++-------- cinder/tests/test_netapp_nfs.py | 4 ++-- cinder/tests/test_volume.py | 6 +++--- cinder/tests/test_volume_types.py | 2 +- cinder/utils.py | 2 +- cinder/volume/driver.py | 2 +- cinder/volume/drivers/huawei/rest_common.py | 4 ++-- cinder/volume/drivers/huawei/ssh_common.py | 4 ++-- cinder/volume/drivers/lvm.py | 2 +- cinder/volume/drivers/netapp/nfs.py | 2 +- cinder/volume/drivers/rbd.py | 2 +- cinder/volume/drivers/vmware/vmdk.py | 4 ++-- cinder/volume/flows/create_volume/__init__.py | 14 +++++++------- cinder/volume/flows/utils.py | 2 +- doc/source/images/rpc/arch.svg | 2 +- 21 files changed, 44 insertions(+), 44 deletions(-) diff --git a/cinder/brick/initiator/connector.py b/cinder/brick/initiator/connector.py index 306d18de0..743d1aff9 100644 --- a/cinder/brick/initiator/connector.py +++ b/cinder/brick/initiator/connector.py @@ -418,7 +418,7 @@ class ISCSIConnector(InitiatorConnector): check_exit_code=[0, 255]) except putils.ProcessExecutionError as err: #as this might be one of many paths, - #only set successfull logins to startup automatically + #only set successful logins to startup automatically if err.exit_code in [15]: self._iscsiadm_update(connection_properties, "node.startup", diff --git a/cinder/taskflow/utils.py b/cinder/taskflow/utils.py index 44a526c6d..cb66fef98 100644 --- a/cinder/taskflow/utils.py +++ b/cinder/taskflow/utils.py @@ -263,7 +263,7 @@ class Runner(object): class TransitionNotifier(object): """A utility helper class that can be used to subscribe to - notifications of events occuring as well as allow a entity to post said + notifications of events occurring as well as allow a entity to post said notifications to subscribers. """ diff --git a/cinder/tests/api/contrib/test_services.py b/cinder/tests/api/contrib/test_services.py index 5e4bf5524..420fcd854 100644 --- a/cinder/tests/api/contrib/test_services.py +++ b/cinder/tests/api/contrib/test_services.py @@ -62,7 +62,7 @@ class FakeRequest(object): # NOTE(uni): deprecating service request key, binary takes precedence -# Still keeping service key here for API compability sake. +# Still keeping service key here for API compatibility sake. class FakeRequestWithService(object): environ = {"cinder.context": context.get_admin_context()} GET = {"service": "cinder-volume"} @@ -79,7 +79,7 @@ class FakeRequestWithHost(object): # NOTE(uni): deprecating service request key, binary takes precedence -# Still keeping service key here for API compability sake. +# Still keeping service key here for API compatibility sake. class FakeRequestWithHostService(object): environ = {"cinder.context": context.get_admin_context()} GET = {"host": "host1", "service": "cinder-volume"} diff --git a/cinder/tests/api/test_router.py b/cinder/tests/api/test_router.py index 9a3a362c6..0aebeaace 100644 --- a/cinder/tests/api/test_router.py +++ b/cinder/tests/api/test_router.py @@ -63,15 +63,15 @@ class VolumeRouterTestCase(test.TestCase): self.assertEqual(200, response.status_int) def test_versions_action_args_index(self): - request_enviroment = {'PATH_INFO': '/'} + request_environment = {'PATH_INFO': '/'} resource = versions.Versions() - result = resource.get_action_args(request_enviroment) + result = resource.get_action_args(request_environment) self.assertEqual(result['action'], 'index') def test_versions_action_args_multi(self): - request_enviroment = {'PATH_INFO': '/fake/path'} + request_environment = {'PATH_INFO': '/fake/path'} resource = versions.Versions() - result = resource.get_action_args(request_enviroment) + result = resource.get_action_args(request_environment) self.assertEqual(result['action'], 'multi') def test_versions_get_most_recent_update(self): diff --git a/cinder/tests/api/v1/test_limits.py b/cinder/tests/api/v1/test_limits.py index 6c7762bb0..2f4414a76 100644 --- a/cinder/tests/api/v1/test_limits.py +++ b/cinder/tests/api/v1/test_limits.py @@ -568,7 +568,7 @@ class WsgiLimiterTest(BaseLimitTestSuite): self.app = limits.WsgiLimiter(TEST_LIMITS) def _request_data(self, verb, path): - """Get data decribing a limit request verb/path.""" + """Get data describing a limit request verb/path.""" return jsonutils.dumps({"verb": verb, "path": path}) def _request(self, verb, url, username=None): diff --git a/cinder/tests/api/v2/test_limits.py b/cinder/tests/api/v2/test_limits.py index 4422b15fa..57c31bb33 100644 --- a/cinder/tests/api/v2/test_limits.py +++ b/cinder/tests/api/v2/test_limits.py @@ -574,7 +574,7 @@ class WsgiLimiterTest(BaseLimitTestSuite): self.app = limits.WsgiLimiter(TEST_LIMITS) def _request_data(self, verb, path): - """Get data decribing a limit request verb/path.""" + """Get data describing a limit request verb/path.""" return jsonutils.dumps({"verb": verb, "path": path}) def _request(self, verb, url, username=None): diff --git a/cinder/tests/test_huawei_hvs.py b/cinder/tests/test_huawei_hvs.py index 55d2b4a90..be24ba56a 100644 --- a/cinder/tests/test_huawei_hvs.py +++ b/cinder/tests/test_huawei_hvs.py @@ -636,10 +636,10 @@ class HVSRESTiSCSIDriverTestCase(test.TestCase): product.appendChild(product_text) storage.appendChild(product) - protocal = doc.createElement('Protocol') - protocal_text = doc.createTextNode('iSCSI') - protocal.appendChild(protocal_text) - storage.appendChild(protocal) + protocol = doc.createElement('Protocol') + protocol_text = doc.createTextNode('iSCSI') + protocol.appendChild(protocol_text) + storage.appendChild(protocol) username = doc.createElement('UserName') username_text = doc.createTextNode('admin') @@ -819,10 +819,10 @@ class HVSRESTFCDriverTestCase(test.TestCase): product.appendChild(product_text) storage.appendChild(product) - protocal = doc.createElement('Protocol') - protocal_text = doc.createTextNode('FC') - protocal.appendChild(protocal_text) - storage.appendChild(protocal) + protocol = doc.createElement('Protocol') + protocol_text = doc.createTextNode('FC') + protocol.appendChild(protocol_text) + storage.appendChild(protocol) username = doc.createElement('UserName') username_text = doc.createTextNode('admin') diff --git a/cinder/tests/test_netapp_nfs.py b/cinder/tests/test_netapp_nfs.py index 61cccf393..948d3c1b4 100644 --- a/cinder/tests/test_netapp_nfs.py +++ b/cinder/tests/test_netapp_nfs.py @@ -73,9 +73,9 @@ class FakeSnapshot(object): return self.__dict__[key] -class FakeResponce(object): +class FakeResponse(object): def __init__(self, status): - """Initialize FakeResponce. + """Initialize FakeResponse. :param status: Either 'failed' or 'passed' """ diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index b0daff791..2debdffc3 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -984,7 +984,7 @@ class VolumeTestCase(BaseVolumeTestCase): self.context, snapshot_id) - def test_cant_delete_volume_in_use(self): + def test_cannot_delete_volume_in_use(self): """Test volume can't be deleted in invalid stats.""" # create a volume and assign to host volume = tests_utils.create_volume(self.context, **self.volume_params) @@ -1029,7 +1029,7 @@ class VolumeTestCase(BaseVolumeTestCase): # clean up self.volume.delete_volume(self.context, volume['id']) - def test_cant_force_delete_attached_volume(self): + def test_cannot_force_delete_attached_volume(self): """Test volume can't be force delete in attached state""" volume = tests_utils.create_volume(self.context, **self.volume_params) self.volume.create_volume(self.context, volume['id']) @@ -1047,7 +1047,7 @@ class VolumeTestCase(BaseVolumeTestCase): self.volume.delete_volume(self.context, volume['id']) - def test_cant_delete_volume_with_snapshots(self): + def test_cannot_delete_volume_with_snapshots(self): """Test volume can't be deleted with dependent snapshots.""" volume = tests_utils.create_volume(self.context, **self.volume_params) self.volume.create_volume(self.context, volume['id']) diff --git a/cinder/tests/test_volume_types.py b/cinder/tests/test_volume_types.py index 6d43925d4..b8aebd31a 100644 --- a/cinder/tests/test_volume_types.py +++ b/cinder/tests/test_volume_types.py @@ -64,7 +64,7 @@ class VolumeTypeTestCase(test.TestCase): for k, v in self.vol_type1_specs.iteritems(): self.assertEqual(v, new['extra_specs'][k], - 'one of fields doesnt match') + 'one of fields does not match') new_all_vtypes = volume_types.get_all_types(self.ctxt) self.assertEqual(len(prev_all_vtypes) + 1, diff --git a/cinder/utils.py b/cinder/utils.py index 17f566c23..d0353a15b 100644 --- a/cinder/utils.py +++ b/cinder/utils.py @@ -221,7 +221,7 @@ class SSHPool(pools.Pool): raise exception.CinderException(msg) # Paramiko by default sets the socket timeout to 0.1 seconds, - # ignoring what we set thru the sshclient. This doesn't help for + # ignoring what we set through the sshclient. This doesn't help for # keeping long lived connections. Hence we have to bypass it, by # overriding it after the transport is initialized. We are setting # the sockettimeout to None and setting a keepalive packet so that, diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index f6f52f788..67c358557 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -141,7 +141,7 @@ class VolumeDriver(object): self.set_execute(execute) self._stats = {} - # set True by manager after succesful check_for_setup + # set True by manager after successful check_for_setup self._initialized = False def set_execute(self, execute): diff --git a/cinder/volume/drivers/huawei/rest_common.py b/cinder/volume/drivers/huawei/rest_common.py index 34f684e8b..4d1f57234 100644 --- a/cinder/volume/drivers/huawei/rest_common.py +++ b/cinder/volume/drivers/huawei/rest_common.py @@ -74,7 +74,7 @@ class HVSCommon(): res = urllib2.urlopen(req).read().decode("utf-8") LOG.debug(_('HVS Response Data: %(res)s') % {'res': res}) except Exception as err: - err_msg = _('Bad reponse from server: %s') % err + err_msg = _('Bad response from server: %s') % err LOG.error(err_msg) raise err @@ -218,7 +218,7 @@ class HVSCommon(): def _get_volume_size(self, poolinfo, volume): """Calculate the volume size. - We should devide the given volume size by 512 for the HVS system + We should divide the given volume size by 512 for the HVS system caculates volume size with sectors, which is 512 bytes. """ diff --git a/cinder/volume/drivers/huawei/ssh_common.py b/cinder/volume/drivers/huawei/ssh_common.py index 660980980..31cc6d5a2 100644 --- a/cinder/volume/drivers/huawei/ssh_common.py +++ b/cinder/volume/drivers/huawei/ssh_common.py @@ -1054,7 +1054,7 @@ class TseriesCommon(): return None def _get_host_map_info(self, hostid): - """Get map infomation of the given host.""" + """Get map information of the given host.""" cli_cmd = 'showhostmap -host %(hostid)s' % {'hostid': hostid} out = self._execute_cli(cli_cmd) @@ -1259,7 +1259,7 @@ class DoradoCommon(TseriesCommon): def _check_conf_file(self): """Check the config file, make sure the key elements are set.""" root = huawei_utils.parse_xml_file(self.xml_conf) - # Check login infomation + # Check login information check_list = ['Storage/ControllerIP0', 'Storage/ControllerIP1', 'Storage/UserName', 'Storage/UserPassword'] for item in check_list: diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 51d3e628f..29fc556fc 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -416,7 +416,7 @@ class LVMISCSIDriver(LVMVolumeDriver, driver.ISCSIDriver): def _create_tgtadm_target(self, iscsi_name, iscsi_target, volume_path, chap_auth, lun=0, check_exit_code=False, old_name=None): - # NOTE(jdg): tgt driver has an issue where with alot of activity + # NOTE(jdg): tgt driver has an issue where with a lot of activity # (or sometimes just randomly) it will get *confused* and attempt # to reuse a target ID, resulting in a target already exists error # Typically a simple retry will address this diff --git a/cinder/volume/drivers/netapp/nfs.py b/cinder/volume/drivers/netapp/nfs.py index 6f826979e..e07457c8e 100644 --- a/cinder/volume/drivers/netapp/nfs.py +++ b/cinder/volume/drivers/netapp/nfs.py @@ -1050,7 +1050,7 @@ class NetAppDirect7modeNfsDriver (NetAppDirectNfsDriver): client.set_api_version(major, minor) def check_for_setup_error(self): - """Checks if setup occured properly.""" + """Checks if setup occurred properly.""" api_version = self._client.get_api_version() if api_version: major, minor = api_version diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index a6445d63a..934d703e2 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -371,7 +371,7 @@ class RBDDriver(driver.VolumeDriver): if not parent: return depth - # If clone depth was reached, flatten should have occured so if it has + # If clone depth was reached, flatten should have occurred so if it has # been exceeded then something has gone wrong. if depth > CONF.rbd_max_clone_depth: raise Exception(_("clone depth exceeds limit of %s") % diff --git a/cinder/volume/drivers/vmware/vmdk.py b/cinder/volume/drivers/vmware/vmdk.py index 82b32f7bc..2d446c1f2 100644 --- a/cinder/volume/drivers/vmware/vmdk.py +++ b/cinder/volume/drivers/vmware/vmdk.py @@ -232,7 +232,7 @@ class VMwareEsxVmdkDriver(driver.VolumeDriver): return self.volumeops.get_vmfolder(datacenter) def _select_datastore_summary(self, size_bytes, datastores): - """Get best summary from datastore list that can accomodate volume. + """Get best summary from datastore list that can accommodate volume. The implementation selects datastore based on maximum relative free space, which is (free_space/total_space) and has free space to @@ -254,7 +254,7 @@ class VMwareEsxVmdkDriver(driver.VolumeDriver): best_summary = summary if not best_summary: - msg = _("Unable to pick datastore to accomodate %(size)s bytes " + msg = _("Unable to pick datastore to accommodate %(size)s bytes " "from the datastores: %(dss)s.") LOG.error(msg % {'size': size_bytes, 'dss': datastores}) raise error_util.VimException(msg % diff --git a/cinder/volume/flows/create_volume/__init__.py b/cinder/volume/flows/create_volume/__init__.py index ddb4fc919..d4fa8a20c 100644 --- a/cinder/volume/flows/create_volume/__init__.py +++ b/cinder/volume/flows/create_volume/__init__.py @@ -212,7 +212,7 @@ class ExtractVolumeRequestTask(base.CinderTask): # TODO(harlowja): what happens if the status changes after this # initial snapshot status check occurs??? Seems like someone # could delete the snapshot after this check passes but before - # the volume is offically created? + # the volume is officially created? raise exception.InvalidSnapshot(reason=msg) snapshot_id = snapshot['id'] return snapshot_id @@ -235,7 +235,7 @@ class ExtractVolumeRequestTask(base.CinderTask): # TODO(harlowja): what happens if the status changes after this # initial volume status check occurs??? Seems like someone # could delete the volume after this check passes but before - # the volume is offically created? + # the volume is officially created? raise exception.InvalidVolume(reason=msg) source_volid = source_volume['id'] return source_volid @@ -475,7 +475,7 @@ class ExtractVolumeRequestTask(base.CinderTask): # TODO(joel-coffman): This special handling of snapshots to ensure that # their volume type matches the source volume is too convoluted. We # should copy encryption metadata from the encrypted volume type to the - # volume upon creation and propogate that information to each snapshot. + # volume upon creation and propagate that information to each snapshot. # This strategy avoid any dependency upon the encrypted volume type. if not volume_type and not source_volume and not snapshot: volume_type = volume_types.get_default_volume_type() @@ -595,7 +595,7 @@ class QuotaReserveTask(base.CinderTask): Reversion strategy: rollback the quota reservation. Warning Warning: if the process that is running this reserve and commit - process fails (or is killed before the quota is rolled back or commited + process fails (or is killed before the quota is rolled back or committed it does appear like the quota will never be rolled back). This makes software upgrades hard (inflight operations will need to be stopped or allowed to complete before the upgrade can occur). *In the future* when @@ -659,7 +659,7 @@ class QuotaReserveTask(base.CinderTask): if not result: return if context.quota_committed: - # The reservations have already been commited and can not be + # The reservations have already been committed and can not be # rolled back at this point. return # We actually produced an output that we can revert so lets attempt @@ -681,7 +681,7 @@ class QuotaCommitTask(base.CinderTask): the initial reservation (see: QuotaReserveTask). Warning Warning: if the process that is running this reserve and commit - process fails (or is killed before the quota is rolled back or commited + process fails (or is killed before the quota is rolled back or committed it does appear like the quota will never be rolled back). This makes software upgrades hard (inflight operations will need to be stopped or allowed to complete before the upgrade can occur). *In the future* when @@ -1615,7 +1615,7 @@ def get_api_flow(scheduler_rpcapi, volume_rpcapi, db, v_uuid = api_flow.add(EntryCreateTask(db)) api_flow.add(QuotaCommitTask()) - # If after commiting something fails, ensure we set the db to failure + # If after committing something fails, ensure we set the db to failure # before reverting any prior tasks. api_flow.add(OnFailureChangeStatusTask(db)) diff --git a/cinder/volume/flows/utils.py b/cinder/volume/flows/utils.py index f40637669..6c6677e15 100644 --- a/cinder/volume/flows/utils.py +++ b/cinder/volume/flows/utils.py @@ -30,7 +30,7 @@ def attach_debug_listeners(flow): These listeners will log when tasks/flows are transitioning from state to state so that said states can be seen in the debug log output which is very - useful for figuring out where problems are occuring. + useful for figuring out where problems are occurring. """ def flow_log_change(state, details): diff --git a/doc/source/images/rpc/arch.svg b/doc/source/images/rpc/arch.svg index 13f0b7965..02e4f5d64 100644 --- a/doc/source/images/rpc/arch.svg +++ b/doc/source/images/rpc/arch.svg @@ -176,7 +176,7 @@ x="4" dy="1.2em" class="st3">NetworkVPN Sheet.16 - VM instance Security group Volume Snapshot VM image IP addres... + VM instance Security group Volume Snapshot VM image IP address... -- 2.45.2