From b5f5935c27427cf9d6c4ac31a8508683c8a88689 Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Tue, 16 May 2017 10:47:19 +0700 Subject: [PATCH] Trivial fix typos Change-Id: Ib6ea796f2163ead6bf13865399c4a2aa89e75a2f --- cinder/api/openstack/api_version_request.py | 2 +- cinder/backup/driver.py | 2 +- .../versions/085_modify_workers_updated_at.py | 4 ++-- .../tests/functional/test_group_snapshots.py | 2 +- cinder/tests/unit/api/v3/test_attachments.py | 20 +++++++++---------- .../unit/backup/drivers/test_backup_google.py | 2 +- .../unit/volume/drivers/disco/__init__.py | 2 +- cinder/tests/unit/volume/test_capabilities.py | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cinder/api/openstack/api_version_request.py b/cinder/api/openstack/api_version_request.py index ee33efd8222..11514b054c9 100644 --- a/cinder/api/openstack/api_version_request.py +++ b/cinder/api/openstack/api_version_request.py @@ -88,7 +88,7 @@ REST_API_VERSION_HISTORY = """ # The minimum and maximum versions of the API supported # The default api version request is defined to be the # minimum version of the API supported. -# Explicitly using /v1 or /v2 enpoints will still work +# Explicitly using /v1 or /v2 endpoints will still work _MIN_API_VERSION = "3.0" _MAX_API_VERSION = "3.31" _LEGACY_API_VERSION1 = "1.0" diff --git a/cinder/backup/driver.py b/cinder/backup/driver.py index 372b2e63aed..f6e1464e47b 100644 --- a/cinder/backup/driver.py +++ b/cinder/backup/driver.py @@ -153,7 +153,7 @@ class BackupMetadataAPI(base.Base): :param metadata: master set of metadata :param fields: list of fields we want to extract - :param excludes: fields to be exluded + :param excludes: fields to be excluded :returns: filtered metadata """ if not fields: diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/085_modify_workers_updated_at.py b/cinder/db/sqlalchemy/migrate_repo/versions/085_modify_workers_updated_at.py index 0b02b986d0e..841acfcef39 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/085_modify_workers_updated_at.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/085_modify_workers_updated_at.py @@ -19,9 +19,9 @@ from sqlalchemy import MetaData, Table def upgrade(migrate_engine): - """Add microseconds precission on updated_at field in MySQL databases. + """Add microseconds precision on updated_at field in MySQL databases. - PostgreSQL, SQLite, and MSSQL have sub-second precission by default, but + PostgreSQL, SQLite, and MSSQL have sub-second precision by default, but MySQL defaults to second precision in DateTime fields, which creates problems for the resource cleanup mechanism. """ diff --git a/cinder/tests/functional/test_group_snapshots.py b/cinder/tests/functional/test_group_snapshots.py index 088737e6a5f..76e98f68c33 100644 --- a/cinder/tests/functional/test_group_snapshots.py +++ b/cinder/tests/functional/test_group_snapshots.py @@ -342,7 +342,7 @@ class GroupSnapshotsTest(functional_helpers._FunctionalTestBase): found_volume = self._poll_volume_while(created_volume_id, ['deleting']) found_group = self._poll_group_while(group_id, ['deleting']) - # Created resoueces should be gone + # Created resources should be gone self.assertFalse(found_group_snapshot) self.assertFalse(found_volume) self.assertFalse(found_group) diff --git a/cinder/tests/unit/api/v3/test_attachments.py b/cinder/tests/unit/api/v3/test_attachments.py index 7a573745154..9ae95c00069 100644 --- a/cinder/tests/unit/api/v3/test_attachments.py +++ b/cinder/tests/unit/api/v3/test_attachments.py @@ -49,13 +49,13 @@ class AttachmentsAPITestCase(test.TestCase): project_id=fake.PROJECT_ID) self.volume2 = self._create_volume(display_name='fake_volume_2', project_id=fake.PROJECT2_ID) - self.attachment1 = self._create_attachement( + self.attachment1 = self._create_attachment( volume_uuid=self.volume1.id, instance_uuid=fake.UUID1) - self.attachment2 = self._create_attachement( + self.attachment2 = self._create_attachment( volume_uuid=self.volume1.id, instance_uuid=fake.UUID1) - self.attachment3 = self._create_attachement( + self.attachment3 = self._create_attachment( volume_uuid=self.volume1.id, instance_uuid=fake.UUID2) - self.attachment4 = self._create_attachement( + self.attachment4 = self._create_attachment( volume_uuid=self.volume2.id, instance_uuid=fake.UUID2) self.addCleanup(self._cleanup) @@ -157,7 +157,7 @@ class AttachmentsAPITestCase(test.TestCase): def test_delete_attachment(self, status, mock_delete): volume1 = self._create_volume(display_name='fake_volume_1', project_id=fake.PROJECT_ID) - attachment = self._create_attachement( + attachment = self._create_attachment( volume_uuid=volume1.id, instance_uuid=fake.UUID1, attach_status=status) req = fakes.HTTPRequest.blank('/v3/%s/attachments/%s' % @@ -178,11 +178,11 @@ class AttachmentsAPITestCase(test.TestCase): mock_delete.assert_called_once_with(req.environ['cinder.context'], attachment.id, mock.ANY) - def _create_attachement(self, ctxt=None, volume_uuid=None, - instance_uuid=None, mountpoint=None, - attach_time=None, detach_time=None, - attach_status=None, attach_mode=None): - """Create a attachement object.""" + def _create_attachment(self, ctxt=None, volume_uuid=None, + instance_uuid=None, mountpoint=None, + attach_time=None, detach_time=None, + attach_status=None, attach_mode=None): + """Create an attachment object.""" ctxt = ctxt or self.ctxt attachment = objects.VolumeAttachment(ctxt) attachment.volume_id = volume_uuid diff --git a/cinder/tests/unit/backup/drivers/test_backup_google.py b/cinder/tests/unit/backup/drivers/test_backup_google.py index c8dde288f31..18b0f7b4fe5 100644 --- a/cinder/tests/unit/backup/drivers/test_backup_google.py +++ b/cinder/tests/unit/backup/drivers/test_backup_google.py @@ -557,7 +557,7 @@ class GoogleBackupDriverTestCase(test.TestCase): self.assertGreater(len(fake_data), len(result)) @gcs_client - def test_prepare_output_data_no_compresssion(self): + def test_prepare_output_data_no_compression(self): self.flags(backup_compression_algorithm='none') service = google_dr.GoogleBackupDriver(self.ctxt) # Set up buffer of 128 zeroed bytes diff --git a/cinder/tests/unit/volume/drivers/disco/__init__.py b/cinder/tests/unit/volume/drivers/disco/__init__.py index 303a19bc78c..f68e84ae7b6 100644 --- a/cinder/tests/unit/volume/drivers/disco/__init__.py +++ b/cinder/tests/unit/volume/drivers/disco/__init__.py @@ -142,7 +142,7 @@ class FakeMethod(object): """"Mock function to delete snapshot.""" def restoreFromSnapshot(self, *args, **kwargs): - """"Mock function to create a volume from a snasphot.""" + """"Mock function to create a volume from a snapshot.""" def restoreDetail(self, *args, **kwargs): """"Mock function to detail the restore operation.""" diff --git a/cinder/tests/unit/volume/test_capabilities.py b/cinder/tests/unit/volume/test_capabilities.py index 6d0c52404f8..20b78522abe 100644 --- a/cinder/tests/unit/volume/test_capabilities.py +++ b/cinder/tests/unit/volume/test_capabilities.py @@ -113,7 +113,7 @@ class VolumeCapabilitiesTestCase(base.BaseVolumeTestCase): mock_init_vendor, mock_get_volume_stats): - # Error test case: propety does not match vendor prefix + # Error test case: property does not match vendor prefix def init_vendor_properties(self): properties = {} self._set_property( @@ -153,7 +153,7 @@ class VolumeCapabilitiesTestCase(base.BaseVolumeTestCase): mock_init_vendor, mock_get_volume_stats): - # Error test case: propety cannot override any standard capabilities + # Error test case: property cannot override any standard capabilities def init_vendor_properties(self): properties = {} self._set_property(