From 582abea303c1aa4656aac284062e68208e033d83 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 14 Dec 2013 12:33:24 +0100 Subject: [PATCH] Fix and enable gating on H402 Summary docstrings should end with punctuation. Also changed it to command-style in a few places. Change-Id: Id94fe995aa05356106ad09899b0ada27d608ff21 --- cinder/api/common.py | 6 ++--- cinder/api/contrib/availability_zones.py | 2 +- cinder/api/contrib/hosts.py | 2 +- cinder/api/contrib/image_create.py | 2 +- cinder/api/contrib/qos_specs_manage.py | 2 +- cinder/api/contrib/quota_classes.py | 4 ++-- cinder/api/contrib/quotas.py | 4 ++-- cinder/api/contrib/services.py | 4 ++-- cinder/api/contrib/types_extra_specs.py | 2 +- .../api/contrib/volume_encryption_metadata.py | 2 +- cinder/api/contrib/volume_image_metadata.py | 2 +- cinder/api/contrib/volume_transfer.py | 4 ++-- cinder/api/middleware/auth.py | 2 +- cinder/api/openstack/__init__.py | 2 +- cinder/api/openstack/wsgi.py | 16 +++++++------- cinder/api/v2/views/volumes.py | 6 ++--- cinder/api/views/availability_zones.py | 2 +- cinder/api/views/types.py | 2 +- cinder/api/xmlutil.py | 2 +- cinder/backup/driver.py | 6 ++--- cinder/backup/drivers/swift.py | 6 ++--- cinder/db/api.py | 2 +- cinder/db/sqlalchemy/api.py | 4 ++-- cinder/image/image_utils.py | 2 +- cinder/scheduler/host_manager.py | 6 ++--- cinder/test.py | 4 ++-- cinder/tests/api/extensions/foxinsocks.py | 2 +- cinder/tests/api/middleware/test_faults.py | 4 ++-- cinder/tests/api/test_extensions.py | 8 +++---- cinder/tests/api/v1/test_limits.py | 2 +- cinder/tests/api/v2/test_limits.py | 2 +- cinder/tests/backup/fake_swift_client.py | 2 +- cinder/tests/scheduler/test_host_manager.py | 4 ++-- cinder/tests/test_backup.py | 22 +++++++++---------- cinder/tests/test_backup_ceph.py | 4 ++-- cinder/tests/test_gpfs.py | 4 ++-- cinder/tests/test_migrations.py | 2 +- cinder/tests/test_netapp.py | 8 +++---- cinder/tests/test_nfs.py | 2 +- cinder/tests/test_service.py | 6 ++--- cinder/tests/test_volume.py | 2 +- cinder/utils.py | 4 ++-- cinder/volume/driver.py | 6 ++--- cinder/volume/drivers/eqlx.py | 2 +- cinder/volume/drivers/huawei/rest_common.py | 2 +- cinder/volume/drivers/netapp/nfs.py | 2 +- cinder/volume/drivers/nfs.py | 2 +- cinder/volume/drivers/san/hp_lefthand.py | 12 +++++----- cinder/volume/drivers/san/solaris.py | 4 ++-- cinder/volume/drivers/sheepdog.py | 20 ++++++++--------- cinder/volume/drivers/storwize_svc.py | 2 +- .../volume/drivers/vmware/read_write_util.py | 2 +- .../volume/drivers/windows/windows_utils.py | 4 ++-- cinder/volume/drivers/xenapi/sm.py | 2 +- cinder/volume/flows/create_volume/__init__.py | 4 ++-- cinder/volume/manager.py | 4 ++-- tox.ini | 2 +- 57 files changed, 123 insertions(+), 123 deletions(-) diff --git a/cinder/api/common.py b/cinder/api/common.py index 2e13691ebbb..889a249a51d 100644 --- a/cinder/api/common.py +++ b/cinder/api/common.py @@ -71,7 +71,7 @@ def get_pagination_params(request): def _get_limit_param(request): - """Extract integer limit from request or fail""" + """Extract integer limit from request or fail.""" try: limit = int(request.GET['limit']) except ValueError: @@ -84,7 +84,7 @@ def _get_limit_param(request): def _get_marker_param(request): - """Extract marker id from request or fail""" + """Extract marker id from request or fail.""" return request.GET['marker'] @@ -275,7 +275,7 @@ class MetaItemDeserializer(wsgi.MetadataXMLDeserializer): class MetadataXMLDeserializer(wsgi.XMLDeserializer): def extract_metadata(self, metadata_node): - """Marshal the metadata attribute of a parsed request""" + """Marshal the metadata attribute of a parsed request.""" if metadata_node is None: return {} metadata = {} diff --git a/cinder/api/contrib/availability_zones.py b/cinder/api/contrib/availability_zones.py index fd2344c490d..2f028110469 100644 --- a/cinder/api/contrib/availability_zones.py +++ b/cinder/api/contrib/availability_zones.py @@ -55,7 +55,7 @@ class Controller(wsgi.Controller): class Availability_zones(extensions.ExtensionDescriptor): - """Describe Availability Zones""" + """Describe Availability Zones.""" name = 'AvailabilityZones' alias = 'os-availability-zone' diff --git a/cinder/api/contrib/hosts.py b/cinder/api/contrib/hosts.py index 69e8070e79c..93c64b7c30b 100644 --- a/cinder/api/contrib/hosts.py +++ b/cinder/api/contrib/hosts.py @@ -250,7 +250,7 @@ class HostController(wsgi.Controller): class Hosts(extensions.ExtensionDescriptor): - """Admin-only host administration""" + """Admin-only host administration.""" name = "Hosts" alias = "os-hosts" diff --git a/cinder/api/contrib/image_create.py b/cinder/api/contrib/image_create.py index d1872914ce9..e34b5d550a7 100644 --- a/cinder/api/contrib/image_create.py +++ b/cinder/api/contrib/image_create.py @@ -23,7 +23,7 @@ from cinder.api import extensions class Image_create(extensions.ExtensionDescriptor): - """Allow creating a volume from an image in the Create Volume v1 API""" + """Allow creating a volume from an image in the Create Volume v1 API.""" name = "CreateVolumeExtension" alias = "os-image-create" diff --git a/cinder/api/contrib/qos_specs_manage.py b/cinder/api/contrib/qos_specs_manage.py index 727d964b8d3..ef8fc987e70 100644 --- a/cinder/api/contrib/qos_specs_manage.py +++ b/cinder/api/contrib/qos_specs_manage.py @@ -416,7 +416,7 @@ class QoSSpecsController(wsgi.Controller): class Qos_specs_manage(extensions.ExtensionDescriptor): - """QoS specs support""" + """QoS specs support.""" name = "Qos_specs_manage" alias = "qos-specs" diff --git a/cinder/api/contrib/quota_classes.py b/cinder/api/contrib/quota_classes.py index c7e6d5f167f..ffa1bf7f95f 100644 --- a/cinder/api/contrib/quota_classes.py +++ b/cinder/api/contrib/quota_classes.py @@ -45,7 +45,7 @@ class QuotaClassTemplate(xmlutil.TemplateBuilder): class QuotaClassSetsController(wsgi.Controller): def _format_quota_set(self, quota_class, quota_set): - """Convert the quota object to a result dict""" + """Convert the quota object to a result dict.""" quota_set['id'] = str(quota_class) @@ -95,7 +95,7 @@ class QuotaClassSetsController(wsgi.Controller): class Quota_classes(extensions.ExtensionDescriptor): - """Quota classes management support""" + """Quota classes management support.""" name = "QuotaClasses" alias = "os-quota-class-sets" diff --git a/cinder/api/contrib/quotas.py b/cinder/api/contrib/quotas.py index 388571de6c0..d9ae464d592 100644 --- a/cinder/api/contrib/quotas.py +++ b/cinder/api/contrib/quotas.py @@ -51,7 +51,7 @@ class QuotaTemplate(xmlutil.TemplateBuilder): class QuotaSetsController(wsgi.Controller): def _format_quota_set(self, project_id, quota_set): - """Convert the quota object to a result dict""" + """Convert the quota object to a result dict.""" quota_set['id'] = str(project_id) @@ -135,7 +135,7 @@ class QuotaSetsController(wsgi.Controller): class Quotas(extensions.ExtensionDescriptor): - """Quotas management support""" + """Quota management support.""" name = "Quotas" alias = "os-quota-sets" diff --git a/cinder/api/contrib/services.py b/cinder/api/contrib/services.py index d242e520998..102668dae19 100644 --- a/cinder/api/contrib/services.py +++ b/cinder/api/contrib/services.py @@ -112,7 +112,7 @@ class ServiceController(wsgi.Controller): @wsgi.serializers(xml=ServicesUpdateTemplate) def update(self, req, id, body): - """Enable/Disable scheduling for a service""" + """Enable/Disable scheduling for a service.""" context = req.environ['cinder.context'] authorize(context) @@ -154,7 +154,7 @@ class ServiceController(wsgi.Controller): class Services(extensions.ExtensionDescriptor): - """Services support""" + """Services support.""" name = "Services" alias = "os-services" diff --git a/cinder/api/contrib/types_extra_specs.py b/cinder/api/contrib/types_extra_specs.py index 9a53941f837..de719f99188 100644 --- a/cinder/api/contrib/types_extra_specs.py +++ b/cinder/api/contrib/types_extra_specs.py @@ -148,7 +148,7 @@ class VolumeTypeExtraSpecsController(wsgi.Controller): class Types_extra_specs(extensions.ExtensionDescriptor): - """Types extra specs support""" + """Type extra specs support.""" name = "TypesExtraSpecs" alias = "os-types-extra-specs" diff --git a/cinder/api/contrib/volume_encryption_metadata.py b/cinder/api/contrib/volume_encryption_metadata.py index d4bded6aed3..e1a6a05354f 100644 --- a/cinder/api/contrib/volume_encryption_metadata.py +++ b/cinder/api/contrib/volume_encryption_metadata.py @@ -38,7 +38,7 @@ class VolumeEncryptionMetadataTemplate(xmlutil.TemplateBuilder): class VolumeEncryptionMetadataController(wsgi.Controller): - """The volume encryption metadata API extension""" + """The volume encryption metadata API extension.""" def _get_volume_encryption_metadata(self, context, volume_id): return db.volume_encryption_metadata_get(context, volume_id) diff --git a/cinder/api/contrib/volume_image_metadata.py b/cinder/api/contrib/volume_image_metadata.py index 7204b29bf10..1a06005c7fe 100644 --- a/cinder/api/contrib/volume_image_metadata.py +++ b/cinder/api/contrib/volume_image_metadata.py @@ -82,7 +82,7 @@ class VolumeImageMetadataController(wsgi.Controller): class Volume_image_metadata(extensions.ExtensionDescriptor): - """Show image metadata associated with the volume""" + """Show image metadata associated with the volume.""" name = "VolumeImageMetadata" alias = "os-vol-image-meta" diff --git a/cinder/api/contrib/volume_transfer.py b/cinder/api/contrib/volume_transfer.py index 88699277a35..f45262fb430 100644 --- a/cinder/api/contrib/volume_transfer.py +++ b/cinder/api/contrib/volume_transfer.py @@ -119,7 +119,7 @@ class VolumeTransferController(wsgi.Controller): @wsgi.serializers(xml=TransfersTemplate) def index(self, req): - """Returns a summary list of transfers""" + """Returns a summary list of transfers.""" return self._get_transfers(req, is_detail=False) @wsgi.serializers(xml=TransfersTemplate) @@ -226,7 +226,7 @@ class VolumeTransferController(wsgi.Controller): class Volume_transfer(extensions.ExtensionDescriptor): - """Volume transfer management support""" + """Volume transfer management support.""" name = "VolumeTransfer" alias = "os-volume-transfer" diff --git a/cinder/api/middleware/auth.py b/cinder/api/middleware/auth.py index 63f2c1d5d08..8672d040849 100644 --- a/cinder/api/middleware/auth.py +++ b/cinder/api/middleware/auth.py @@ -74,7 +74,7 @@ class InjectContext(base_wsgi.Middleware): class CinderKeystoneContext(base_wsgi.Middleware): - """Make a request context from keystone headers""" + """Make a request context from keystone headers.""" @webob.dec.wsgify(RequestClass=base_wsgi.Request) def __call__(self, req): diff --git a/cinder/api/openstack/__init__.py b/cinder/api/openstack/__init__.py index df48d95075c..9eb2bdee3fb 100644 --- a/cinder/api/openstack/__init__.py +++ b/cinder/api/openstack/__init__.py @@ -59,7 +59,7 @@ class APIRouter(base_wsgi.Router): @classmethod def factory(cls, global_config, **local_config): - """Simple paste factory, :class:`cinder.wsgi.Router` doesn't have""" + """Simple paste factory, :class:`cinder.wsgi.Router` doesn't have.""" return cls() def __init__(self, ext_mgr=None): diff --git a/cinder/api/openstack/wsgi.py b/cinder/api/openstack/wsgi.py index 70d127e8136..2e951adc032 100644 --- a/cinder/api/openstack/wsgi.py +++ b/cinder/api/openstack/wsgi.py @@ -204,7 +204,7 @@ class ActionDispatcher(object): class TextDeserializer(ActionDispatcher): - """Default request body deserialization""" + """Default request body deserialization.""" def deserialize(self, datastring, action='default'): return self.dispatch(datastring, action=action) @@ -278,20 +278,20 @@ class XMLDeserializer(TextDeserializer): return None def find_first_child_named(self, parent, name): - """Search a nodes children for the first child with a given name""" + """Search a nodes children for the first child with a given name.""" for node in parent.childNodes: if node.nodeName == name: return node return None def find_children_named(self, parent, name): - """Return all of a nodes children who have the given name""" + """Return all of a nodes children who have the given name.""" for node in parent.childNodes: if node.nodeName == name: yield node def extract_text(self, node): - """Get the text field contained by the given node""" + """Get the text field contained by the given node.""" if len(node.childNodes) == 1: child = node.childNodes[0] if child.nodeType == child.TEXT_NODE: @@ -299,7 +299,7 @@ class XMLDeserializer(TextDeserializer): return "" def find_attribute_or_element(self, parent, name): - """Get an attribute value; fallback to an element if not found""" + """Get an attribute value; fallback to an element if not found.""" if parent.hasAttribute(name): return parent.getAttribute(name) @@ -316,7 +316,7 @@ class XMLDeserializer(TextDeserializer): class MetadataXMLDeserializer(XMLDeserializer): def extract_metadata(self, metadata_node): - """Marshal the metadata attribute of a parsed request""" + """Marshal the metadata attribute of a parsed request.""" metadata = {} if metadata_node is not None: for meta_node in self.find_children_named(metadata_node, "meta"): @@ -326,7 +326,7 @@ class MetadataXMLDeserializer(XMLDeserializer): class DictSerializer(ActionDispatcher): - """Default request body serialization""" + """Default request body serialization.""" def serialize(self, data, action='default'): return self.dispatch(data, action=action) @@ -336,7 +336,7 @@ class DictSerializer(ActionDispatcher): class JSONDictSerializer(DictSerializer): - """Default JSON request body serialization""" + """Default JSON request body serialization.""" def default(self, data): return jsonutils.dumps(data) diff --git a/cinder/api/v2/views/volumes.py b/cinder/api/v2/views/volumes.py index ca78b87e67e..f904395814e 100644 --- a/cinder/api/v2/views/volumes.py +++ b/cinder/api/v2/views/volumes.py @@ -73,7 +73,7 @@ class ViewBuilder(common.ViewBuilder): } def _get_attachments(self, volume): - """Retrieves the attachments of the volume object""" + """Retrieve the attachments of the volume object.""" attachments = [] if volume['attach_status'] == 'attached': @@ -94,7 +94,7 @@ class ViewBuilder(common.ViewBuilder): return attachments def _get_volume_metadata(self, volume): - """Retrieves the metadata of the volume object""" + """Retrieve the metadata of the volume object.""" if volume.get('volume_metadata'): metadata = volume.get('volume_metadata') return dict((item['key'], item['value']) for item in metadata) @@ -105,7 +105,7 @@ class ViewBuilder(common.ViewBuilder): return {} def _get_volume_type(self, volume): - """Retrieves the type the volume object is""" + """Retrieve the type the volume object.""" if volume['volume_type_id'] and volume.get('volume_type'): return volume['volume_type']['name'] else: diff --git a/cinder/api/views/availability_zones.py b/cinder/api/views/availability_zones.py index 5031cc27f01..bcf658af6be 100644 --- a/cinder/api/views/availability_zones.py +++ b/cinder/api/views/availability_zones.py @@ -17,7 +17,7 @@ import cinder.api.common class ViewBuilder(cinder.api.common.ViewBuilder): - """Map cinder.volumes.api list_availability_zones response into dicts""" + """Map cinder.volumes.api list_availability_zones response into dicts.""" def list(self, request, availability_zones): def fmt(az): diff --git a/cinder/api/views/types.py b/cinder/api/views/types.py index 675ec01fe55..1552d72a63f 100644 --- a/cinder/api/views/types.py +++ b/cinder/api/views/types.py @@ -28,7 +28,7 @@ class ViewBuilder(common.ViewBuilder): return trimmed if brief else dict(volume_type=trimmed) def index(self, request, volume_types): - """Index over trimmed volume types""" + """Index over trimmed volume types.""" volume_types_list = [self.show(request, volume_type, True) for volume_type in volume_types] return dict(volume_types=volume_types_list) diff --git a/cinder/api/xmlutil.py b/cinder/api/xmlutil.py index a64e91f9fde..728d4761d48 100644 --- a/cinder/api/xmlutil.py +++ b/cinder/api/xmlutil.py @@ -346,7 +346,7 @@ class TemplateElement(object): pass def getAttrib(self, obj): - """Get attribute""" + """Get attribute.""" tmpattrib = {} #Now set up all the attributes... for key, value in self.attrib.items(): diff --git a/cinder/backup/driver.py b/cinder/backup/driver.py index 59525d07ebb..241ca834830 100644 --- a/cinder/backup/driver.py +++ b/cinder/backup/driver.py @@ -21,13 +21,13 @@ from cinder.db import base class BackupDriver(base.Base): def backup(self, backup, volume_file): - """Starts a backup of a specified volume""" + """Start a backup of a specified volume.""" raise NotImplementedError() def restore(self, backup, volume_id, volume_file): - """Restores a saved backup""" + """Restore a saved backup.""" raise NotImplementedError() def delete(self, backup): - """Deletes a saved backup""" + """Delete a saved backup.""" raise NotImplementedError() diff --git a/cinder/backup/drivers/swift.py b/cinder/backup/drivers/swift.py index 655bc65260a..0073354b0dc 100644 --- a/cinder/backup/drivers/swift.py +++ b/cinder/backup/drivers/swift.py @@ -225,7 +225,7 @@ class SwiftBackupDriver(BackupDriver): return metadata def _prepare_backup(self, backup): - """Prepare the backup process and return the backup metadata""" + """Prepare the backup process and return the backup metadata.""" backup_id = backup['id'] volume_id = backup['volume_id'] volume = self.db.volume_get(self.context, volume_id) @@ -259,7 +259,7 @@ class SwiftBackupDriver(BackupDriver): return object_meta, container def _backup_chunk(self, backup, container, data, data_offset, object_meta): - """Backup data chunk based on the object metadata and offset""" + """Backup data chunk based on the object metadata and offset.""" object_prefix = object_meta['prefix'] object_list = object_meta['list'] object_id = object_meta['id'] @@ -313,7 +313,7 @@ class SwiftBackupDriver(BackupDriver): eventlet.sleep(0) def _finalize_backup(self, backup, container, object_meta): - """Finalize the backup by updating its metadata on Swift""" + """Finalize the backup by updating its metadata on Swift.""" object_list = object_meta['list'] object_id = object_meta['id'] try: diff --git a/cinder/db/api.py b/cinder/db/api.py index 8af6c557a9f..e4164253df7 100644 --- a/cinder/db/api.py +++ b/cinder/db/api.py @@ -80,7 +80,7 @@ IMPL = db_api.DBAPI(backend_mapping=_BACKEND_MAPPING) class NoMoreTargets(exception.CinderException): - """No more available targets""" + """No more available targets.""" pass diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index 54a11e0a7b6..6260518948b 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -1718,7 +1718,7 @@ def _volume_type_get(context, id, session=None, inactive=False): @require_context def volume_type_get(context, id, inactive=False): - """Returns a dict describing specific volume_type""" + """Return a dict describing specific volume_type.""" return _volume_type_get(context, id, None, inactive) @@ -1738,7 +1738,7 @@ def _volume_type_get_by_name(context, name, session=None): @require_context def volume_type_get_by_name(context, name): - """Returns a dict describing specific volume_type""" + """Return a dict describing specific volume_type.""" return _volume_type_get_by_name(context, name) diff --git a/cinder/image/image_utils.py b/cinder/image/image_utils.py index 2b870468d50..47761b51b69 100644 --- a/cinder/image/image_utils.py +++ b/cinder/image/image_utils.py @@ -62,7 +62,7 @@ def qemu_img_info(path): def convert_image(source, dest, out_format): - """Convert image to other format""" + """Convert image to other format.""" cmd = ('qemu-img', 'convert', '-O', out_format, source, dest) utils.execute(*cmd, run_as_root=True) diff --git a/cinder/scheduler/host_manager.py b/cinder/scheduler/host_manager.py index 5b3f17be478..7cb8adfaddb 100644 --- a/cinder/scheduler/host_manager.py +++ b/cinder/scheduler/host_manager.py @@ -133,7 +133,7 @@ class HostState(object): self.updated = capability['timestamp'] def consume_from_volume(self, volume): - """Incrementally update host state from an volume""" + """Incrementally update host state from an volume.""" volume_gb = volume['size'] if self.free_capacity_gb == 'infinite': # There's virtually infinite space on back-end @@ -220,7 +220,7 @@ class HostManager(object): def get_filtered_hosts(self, hosts, filter_properties, filter_class_names=None): - """Filter hosts and return only ones passing all filters""" + """Filter hosts and return only ones passing all filters.""" filter_classes = self._choose_host_filters(filter_class_names) return self.filter_handler.get_filtered_objects(filter_classes, hosts, @@ -228,7 +228,7 @@ class HostManager(object): def get_weighed_hosts(self, hosts, weight_properties, weigher_class_names=None): - """Weigh the hosts""" + """Weigh the hosts.""" weigher_classes = self._choose_host_weighers(weigher_class_names) return self.weight_handler.get_weighed_objects(weigher_classes, hosts, diff --git a/cinder/test.py b/cinder/test.py index 6eff6b2b0c7..8eb25333791 100644 --- a/cinder/test.py +++ b/cinder/test.py @@ -270,7 +270,7 @@ class TestCase(testtools.TestCase): }) def assertGreater(self, first, second, msg=None): - """Python < v2.7 compatibility. Assert 'first' > 'second'""" + """Python < v2.7 compatibility. Assert 'first' > 'second'.""" try: f = super(TestCase, self).assertGreater except AttributeError: @@ -281,7 +281,7 @@ class TestCase(testtools.TestCase): f(first, second, msg=msg) def assertGreaterEqual(self, first, second, msg=None): - """Python < v2.7 compatibility. Assert 'first' >= 'second'""" + """Python < v2.7 compatibility. Assert 'first' >= 'second'.""" try: f = super(TestCase, self).assertGreaterEqual except AttributeError: diff --git a/cinder/tests/api/extensions/foxinsocks.py b/cinder/tests/api/extensions/foxinsocks.py index 0f1e7a26be4..53ae39e88fa 100644 --- a/cinder/tests/api/extensions/foxinsocks.py +++ b/cinder/tests/api/extensions/foxinsocks.py @@ -61,7 +61,7 @@ class FoxInSocksFlavorBandsControllerExtension(wsgi.Controller): class Foxinsocks(extensions.ExtensionDescriptor): - """The Fox In Socks Extension""" + """The Fox In Socks Extension.""" name = "Fox In Socks" alias = "FOXNSOX" diff --git a/cinder/tests/api/middleware/test_faults.py b/cinder/tests/api/middleware/test_faults.py index 18da123bce7..790c8f6f8ce 100644 --- a/cinder/tests/api/middleware/test_faults.py +++ b/cinder/tests/api/middleware/test_faults.py @@ -169,12 +169,12 @@ class TestFaults(test.TestCase): self.assertIn("Entrada invalida: El valor es invalido", resp.body) def test_fault_has_status_int(self): - """Ensure the status_int is set correctly on faults""" + """Ensure the status_int is set correctly on faults.""" fault = wsgi.Fault(webob.exc.HTTPBadRequest(explanation='what?')) self.assertEqual(fault.status_int, 400) def test_xml_serializer(self): - """Ensure that a v1.1 request responds with a v1 xmlns""" + """Ensure that a v1.1 request responds with a v1 xmlns.""" request = webob.Request.blank('/v1', headers={"Accept": "application/xml"}) diff --git a/cinder/tests/api/test_extensions.py b/cinder/tests/api/test_extensions.py index 65bfe101bdb..1cbdfd81baf 100644 --- a/cinder/tests/api/test_extensions.py +++ b/cinder/tests/api/test_extensions.py @@ -74,7 +74,7 @@ class ExtensionControllerTest(ExtensionTestCase): fox_ext, {'namespace': 'http://www.fox.in.socks/api/ext/pie/v1.0', 'name': 'Fox In Socks', 'updated': '2011-01-22T13:25:27-06:00', - 'description': 'The Fox In Socks Extension', + 'description': 'The Fox In Socks Extension.', 'alias': 'FOXNSOX', 'links': []}, ) @@ -97,7 +97,7 @@ class ExtensionControllerTest(ExtensionTestCase): {"namespace": "http://www.fox.in.socks/api/ext/pie/v1.0", "name": "Fox In Socks", "updated": "2011-01-22T13:25:27-06:00", - "description": "The Fox In Socks Extension", + "description": "The Fox In Socks Extension.", "alias": "FOXNSOX", "links": []}) @@ -130,7 +130,7 @@ class ExtensionControllerTest(ExtensionTestCase): self.assertEqual(fox_ext.get('updated'), '2011-01-22T13:25:27-06:00') self.assertEqual( fox_ext.findtext('{0}description'.format(NS)), - 'The Fox In Socks Extension') + 'The Fox In Socks Extension.') xmlutil.validate_schema(root, 'extensions') @@ -152,6 +152,6 @@ class ExtensionControllerTest(ExtensionTestCase): self.assertEqual(root.get('updated'), '2011-01-22T13:25:27-06:00') self.assertEqual( root.findtext('{0}description'.format(NS)), - 'The Fox In Socks Extension') + 'The Fox In Socks Extension.') xmlutil.validate_schema(root, 'extension') diff --git a/cinder/tests/api/v1/test_limits.py b/cinder/tests/api/v1/test_limits.py index 2f4414a760f..755a0532320 100644 --- a/cinder/tests/api/v1/test_limits.py +++ b/cinder/tests/api/v1/test_limits.py @@ -276,7 +276,7 @@ class LimitMiddlewareTest(BaseLimitTestSuite): self.assertEqual(value, expected) def test_limited_request_xml(self): - """Test a rate-limited (413) response as XML""" + """Test a rate-limited (413) response as XML.""" request = webob.Request.blank("/") response = request.get_response(self.app) self.assertEqual(200, response.status_int) diff --git a/cinder/tests/api/v2/test_limits.py b/cinder/tests/api/v2/test_limits.py index 57c31bb3331..6c2316cd186 100644 --- a/cinder/tests/api/v2/test_limits.py +++ b/cinder/tests/api/v2/test_limits.py @@ -278,7 +278,7 @@ class LimitMiddlewareTest(BaseLimitTestSuite): self.assertEqual(value, expected) def test_limited_request_xml(self): - """Test a rate-limited (413) response as XML""" + """Test a rate-limited (413) response as XML.""" request = webob.Request.blank("/") response = request.get_response(self.app) self.assertEqual(200, response.status_int) diff --git a/cinder/tests/backup/fake_swift_client.py b/cinder/tests/backup/fake_swift_client.py index ccf9982876f..dc35ea7f2c5 100644 --- a/cinder/tests/backup/fake_swift_client.py +++ b/cinder/tests/backup/fake_swift_client.py @@ -37,7 +37,7 @@ class FakeSwiftClient(object): class FakeSwiftConnection(object): - """Logging calls instead of executing""" + """Logging calls instead of executing.""" def __init__(self, *args, **kwargs): pass diff --git a/cinder/tests/scheduler/test_host_manager.py b/cinder/tests/scheduler/test_host_manager.py index 01bc8590415..c661fa5c176 100644 --- a/cinder/tests/scheduler/test_host_manager.py +++ b/cinder/tests/scheduler/test_host_manager.py @@ -41,7 +41,7 @@ class FakeFilterClass2(filters.BaseHostFilter): class HostManagerTestCase(test.TestCase): - """Test case for HostManager class""" + """Test case for HostManager class.""" def setUp(self): super(HostManagerTestCase, self).setUp() @@ -204,7 +204,7 @@ class HostManagerTestCase(test.TestCase): class HostStateTestCase(test.TestCase): - """Test case for HostState class""" + """Test case for HostState class.""" def test_update_from_volume_capability(self): fake_host = host_manager.HostState('host1') diff --git a/cinder/tests/test_backup.py b/cinder/tests/test_backup.py index 696e29c9ba9..c8b33779f69 100644 --- a/cinder/tests/test_backup.py +++ b/cinder/tests/test_backup.py @@ -151,7 +151,7 @@ class BackupTestCase(test.TestCase): backup_id) def test_create_backup_with_error(self): - """Test error handling when an error occurs during backup creation""" + """Test error handling when error occurs during backup creation.""" vol_id = self._create_volume_db_entry(size=1) backup_id = self._create_backup_db_entry(volume_id=vol_id) @@ -171,7 +171,7 @@ class BackupTestCase(test.TestCase): self.assertEqual(backup['status'], 'error') def test_create_backup(self): - """Test normal backup creation""" + """Test normal backup creation.""" vol_size = 1 vol_id = self._create_volume_db_entry(size=vol_size) backup_id = self._create_backup_db_entry(volume_id=vol_id) @@ -191,7 +191,7 @@ class BackupTestCase(test.TestCase): def test_restore_backup_with_bad_volume_status(self): """Test error handling when restoring a backup to a volume - with a bad status + with a bad status. """ vol_id = self._create_volume_db_entry(status='available', size=1) backup_id = self._create_backup_db_entry(volume_id=vol_id) @@ -205,7 +205,7 @@ class BackupTestCase(test.TestCase): def test_restore_backup_with_bad_backup_status(self): """Test error handling when restoring a backup with a backup - with a bad status + with a bad status. """ vol_id = self._create_volume_db_entry(status='restoring-backup', size=1) @@ -222,7 +222,7 @@ class BackupTestCase(test.TestCase): self.assertEqual(backup['status'], 'error') def test_restore_backup_with_driver_error(self): - """Test error handling when an error occurs during backup restore""" + """Test error handling when an error occurs during backup restore.""" vol_id = self._create_volume_db_entry(status='restoring-backup', size=1) backup_id = self._create_backup_db_entry(status='restoring', @@ -246,7 +246,7 @@ class BackupTestCase(test.TestCase): def test_restore_backup_with_bad_service(self): """Test error handling when attempting a restore of a backup - with a different service to that used to create the backup + with a different service to that used to create the backup. """ vol_id = self._create_volume_db_entry(status='restoring-backup', size=1) @@ -272,7 +272,7 @@ class BackupTestCase(test.TestCase): self.assertEqual(backup['status'], 'available') def test_restore_backup(self): - """Test normal backup restoration""" + """Test normal backup restoration.""" vol_size = 1 vol_id = self._create_volume_db_entry(status='restoring-backup', size=vol_size) @@ -293,7 +293,7 @@ class BackupTestCase(test.TestCase): def test_delete_backup_with_bad_backup_status(self): """Test error handling when deleting a backup with a backup - with a bad status + with a bad status. """ vol_id = self._create_volume_db_entry(size=1) backup_id = self._create_backup_db_entry(status='available', @@ -320,7 +320,7 @@ class BackupTestCase(test.TestCase): def test_delete_backup_with_bad_service(self): """Test error handling when attempting a delete of a backup - with a different service to that used to create the backup + with a different service to that used to create the backup. """ vol_id = self._create_volume_db_entry(size=1) backup_id = self._create_backup_db_entry(status='deleting', @@ -345,7 +345,7 @@ class BackupTestCase(test.TestCase): self.backup_mgr.delete_backup(self.ctxt, backup_id) def test_delete_backup(self): - """Test normal backup deletion""" + """Test normal backup deletion.""" vol_id = self._create_volume_db_entry(size=1) backup_id = self._create_backup_db_entry(status='deleting', volume_id=vol_id) @@ -373,7 +373,7 @@ class BackupTestCase(test.TestCase): def test_backup_get_all_by_project_with_deleted(self): """Test deleted backups don't show up in backup_get_all_by_project. - Unless context.read_deleted is 'yes' + Unless context.read_deleted is 'yes'. """ backups = db.backup_get_all_by_project(self.ctxt, 'fake') self.assertEqual(len(backups), 0) diff --git a/cinder/tests/test_backup_ceph.py b/cinder/tests/test_backup_ceph.py index d0d08323356..f9df535135e 100644 --- a/cinder/tests/test_backup_ceph.py +++ b/cinder/tests/test_backup_ceph.py @@ -12,7 +12,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -""" Tests for Ceph backup service """ +""" Tests for Ceph backup service.""" import fcntl import hashlib @@ -40,7 +40,7 @@ LOG = logging.getLogger(__name__) class BackupCephTestCase(test.TestCase): - """Test Case for backup to Ceph object store""" + """Test Case for backup to Ceph object store.""" def _create_volume_db_entry(self, id, size): vol = {'id': id, 'size': size, 'status': 'available'} diff --git a/cinder/tests/test_gpfs.py b/cinder/tests/test_gpfs.py index 3dd7eaf1ea3..a04d69b87fd 100644 --- a/cinder/tests/test_gpfs.py +++ b/cinder/tests/test_gpfs.py @@ -130,7 +130,7 @@ class GPFSDriverTestCase(test.TestCase): super(GPFSDriverTestCase, self).tearDown() def test_create_delete_volume_full_backing_file(self): - """create and delete vol with full creation method""" + """Create and delete vol with full creation method.""" CONF.gpfs_sparse_volumes = False vol = test_utils.create_volume(self.context, host=CONF.host) volume_id = vol['id'] @@ -142,7 +142,7 @@ class GPFSDriverTestCase(test.TestCase): self.assertFalse(os.path.exists(path)) def test_create_delete_volume_sparse_backing_file(self): - """create and delete vol with default sparse creation method""" + """Create and delete vol with default sparse creation method.""" CONF.gpfs_sparse_volumes = True vol = test_utils.create_volume(self.context, host=CONF.host) volume_id = vol['id'] diff --git a/cinder/tests/test_migrations.py b/cinder/tests/test_migrations.py index 25930698774..b99de953892 100644 --- a/cinder/tests/test_migrations.py +++ b/cinder/tests/test_migrations.py @@ -538,7 +538,7 @@ class TestMigrations(test.TestCase): self.assertEqual(0, len(snapshots.c.volume_id.foreign_keys)) def test_migration_008(self): - """Test that adding and removing the backups table works correctly""" + """Test that adding and removing the backups table works correctly.""" for (key, engine) in self.engines.items(): migration_api.version_control(engine, TestMigrations.REPOSITORY, diff --git a/cinder/tests/test_netapp.py b/cinder/tests/test_netapp.py index 8244553fa4d..37040b90d0f 100644 --- a/cinder/tests/test_netapp.py +++ b/cinder/tests/test_netapp.py @@ -61,7 +61,7 @@ class FakeHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): class FakeHttplibSocket(object): - """A fake socket implementation for httplib.HTTPResponse""" + """A fake socket implementation for httplib.HTTPResponse.""" def __init__(self, value): self._rbuffer = StringIO.StringIO(value) self._wbuffer = StringIO.StringIO('') @@ -93,7 +93,7 @@ RESPONSE_SUFFIX_DIRECT = """""" class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): - """HTTP handler that fakes enough stuff to allow the driver to run""" + """HTTP handler that fakes enough stuff to allow the driver to run.""" def do_GET(s): """Respond to a GET request.""" @@ -433,7 +433,7 @@ class FakeDirectCMODEServerHandler(FakeHTTPRequestHandler): @staticmethod def _get_child_content(self, name): - """Get the content of the child""" + """Get the content of the child.""" for child in self.iterchildren(): if child.tag == name or etree.QName(child.tag).localname == name: return child.text @@ -680,7 +680,7 @@ class NetAppDriverNegativeTestCase(test.TestCase): class FakeDirect7MODEServerHandler(FakeHTTPRequestHandler): - """HTTP handler that fakes enough stuff to allow the driver to run""" + """HTTP handler that fakes enough stuff to allow the driver to run.""" def do_GET(s): """Respond to a GET request.""" diff --git a/cinder/tests/test_nfs.py b/cinder/tests/test_nfs.py index 54aba6d22dc..e4c84d7de6e 100644 --- a/cinder/tests/test_nfs.py +++ b/cinder/tests/test_nfs.py @@ -606,7 +606,7 @@ class NfsDriverTestCase(test.TestCase): mox.VerifyAll() def test_get_volume_stats(self): - """get_volume_stats must fill the correct values""" + """get_volume_stats must fill the correct values.""" mox = self._mox drv = self._driver diff --git a/cinder/tests/test_service.py b/cinder/tests/test_service.py index c385f90d08e..29ac18e22c9 100644 --- a/cinder/tests/test_service.py +++ b/cinder/tests/test_service.py @@ -49,7 +49,7 @@ CONF.register_opts(test_service_opts) class FakeManager(manager.Manager): - """Fake manager for tests""" + """Fake manager for tests.""" def __init__(self, host=None, db_driver=None, service_name=None): super(FakeManager, self).__init__(host=host, @@ -65,7 +65,7 @@ class ExtendedService(service.Service): class ServiceManagerTestCase(test.TestCase): - """Test cases for Services""" + """Test cases for Services.""" def test_message_gets_to_manager(self): serv = service.Service('test', @@ -109,7 +109,7 @@ class ServiceFlagsTestCase(test.TestCase): class ServiceTestCase(test.TestCase): - """Test cases for Services""" + """Test cases for Services.""" def setUp(self): super(ServiceTestCase, self).setUp() diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index 4d28c267555..043d0acb9d3 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -1313,7 +1313,7 @@ class VolumeTestCase(BaseVolumeTestCase): self.volume.delete_volume(self.context, volume['id']) def test_cannot_force_delete_attached_volume(self): - """Test volume can't be force delete in attached state""" + """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']) volume['status'] = 'in-use' diff --git a/cinder/utils.py b/cinder/utils.py index d0353a15bd0..f112ad549bc 100644 --- a/cinder/utils.py +++ b/cinder/utils.py @@ -669,7 +669,7 @@ def make_dev_path(dev, partition=None, base='/dev'): def total_seconds(td): - """Local total_seconds implementation for compatibility with python 2.6""" + """Local total_seconds implementation for compatibility with python 2.6.""" if hasattr(td, 'total_seconds'): return td.total_seconds() else: @@ -767,7 +767,7 @@ def tempdir(**kwargs): def walk_class_hierarchy(clazz, encountered=None): - """Walk class hierarchy, yielding most derived classes first""" + """Walk class hierarchy, yielding most derived classes first.""" if not encountered: encountered = [] for subclass in clazz.__subclasses__(): diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 67c35855739..608ddb90459 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -258,11 +258,11 @@ class VolumeDriver(object): return None def do_setup(self, context): - """Any initialization the volume driver does while starting""" + """Any initialization the volume driver does while starting.""" pass def validate_connector(self, connector): - """Fail if connector doesn't contain all the data needed by driver""" + """Fail if connector doesn't contain all the data needed by driver.""" pass def _copy_volume_data_cleanup(self, context, volume, properties, @@ -667,7 +667,7 @@ class ISCSIDriver(VolumeDriver): pass def _get_iscsi_initiator(self): - """Get iscsi initiator name for this machine""" + """Get iscsi initiator name for this machine.""" # NOTE openiscsi stores initiator name in a file that # needs root permission to read. contents = utils.read_file_as_root('/etc/iscsi/initiatorname.iscsi') diff --git a/cinder/volume/drivers/eqlx.py b/cinder/volume/drivers/eqlx.py index 75cca0f4693..fa9e4318e8e 100644 --- a/cinder/volume/drivers/eqlx.py +++ b/cinder/volume/drivers/eqlx.py @@ -450,7 +450,7 @@ class DellEQLSanISCSIDriver(SanISCSIDriver): pass def extend_volume(self, volume, new_size): - """Extend the size of the volume""" + """Extend the size of the volume.""" try: self._eql_execute('volume', 'select', volume['name'], 'size', "%sG" % new_size) diff --git a/cinder/volume/drivers/huawei/rest_common.py b/cinder/volume/drivers/huawei/rest_common.py index 4d1f57234f0..2a8c7c36dbb 100644 --- a/cinder/volume/drivers/huawei/rest_common.py +++ b/cinder/volume/drivers/huawei/rest_common.py @@ -123,7 +123,7 @@ class HVSCommon(): lunparam['INITIALDISTRIBUTEPOLICY'] = "2" def _init_lun_parameters(self, name, parameters): - """Init basic LUN parameters """ + """Init basic LUN parameters.""" lunparam = {"TYPE": "11", "NAME": name, "PARENTTYPE": "216", diff --git a/cinder/volume/drivers/netapp/nfs.py b/cinder/volume/drivers/netapp/nfs.py index 2c3dfba32cf..c26f2606972 100644 --- a/cinder/volume/drivers/netapp/nfs.py +++ b/cinder/volume/drivers/netapp/nfs.py @@ -554,7 +554,7 @@ class NetAppNFSDriver(nfs.NfsDriver): raise NotImplementedError() def _check_share_in_use(self, conn, dir): - """Checks if share is cinder mounted and returns it. """ + """Checks if share is cinder mounted and returns it.""" try: if conn: host = conn.split(':')[0] diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index afa91bba373..cbb121baf29 100644 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -408,7 +408,7 @@ class NfsDriver(RemoteFsDriver): self._remotefsclient.set_execute(execute) def do_setup(self, context): - """Any initialization the volume driver does while starting""" + """Any initialization the volume driver does while starting.""" super(NfsDriver, self).do_setup(context) config = self.configuration.nfs_shares_config diff --git a/cinder/volume/drivers/san/hp_lefthand.py b/cinder/volume/drivers/san/hp_lefthand.py index 36c351cc7bf..8a96d25d480 100644 --- a/cinder/volume/drivers/san/hp_lefthand.py +++ b/cinder/volume/drivers/san/hp_lefthand.py @@ -78,7 +78,7 @@ class HpSanISCSIDriver(SanISCSIDriver): self.cluster_vip = None def _cliq_run(self, verb, cliq_args, check_exit_code=True): - """Runs a CLIQ command over SSH, without doing any result parsing""" + """Runs a CLIQ command over SSH, without doing any result parsing.""" cmd_list = [verb] for k, v in cliq_args.items(): cmd_list.append("%s=%s" % (k, v)) @@ -86,7 +86,7 @@ class HpSanISCSIDriver(SanISCSIDriver): return self._run_ssh(cmd_list, check_exit_code) def _cliq_run_xml(self, verb, cliq_args, check_cliq_result=True): - """Runs a CLIQ command over SSH, parsing and checking the output""" + """Runs a CLIQ command over SSH, parsing and checking the output.""" cliq_args['output'] = 'XML' (out, _err) = self._cliq_run(verb, cliq_args, check_cliq_result) @@ -112,7 +112,7 @@ class HpSanISCSIDriver(SanISCSIDriver): return result_xml def _cliq_get_cluster_info(self, cluster_name): - """Queries for info about the cluster (including IP)""" + """Queries for info about the cluster (including IP).""" cliq_args = {} cliq_args['clusterName'] = cluster_name cliq_args['searchDepth'] = '1' @@ -123,7 +123,7 @@ class HpSanISCSIDriver(SanISCSIDriver): return result_xml def _cliq_get_cluster_vip(self, cluster_name): - """Gets the IP on which a cluster shares iSCSI volumes""" + """Gets the IP on which a cluster shares iSCSI volumes.""" cluster_xml = self._cliq_get_cluster_info(cluster_name) vips = [] @@ -140,7 +140,7 @@ class HpSanISCSIDriver(SanISCSIDriver): raise exception.VolumeBackendAPIException(data=msg) def _cliq_get_volume_info(self, volume_name): - """Gets the volume info, including IQN""" + """Gets the volume info, including IQN.""" cliq_args = {} cliq_args['volumeName'] = volume_name result_xml = self._cliq_run_xml("getVolumeInfo", cliq_args) @@ -193,7 +193,7 @@ class HpSanISCSIDriver(SanISCSIDriver): return volume_attributes def _cliq_get_snapshot_info(self, snapshot_name): - """Gets the snapshot info, including IQN""" + """Gets the snapshot info, including IQN.""" cliq_args = {} cliq_args['snapshotName'] = snapshot_name result_xml = self._cliq_run_xml("getSnapshotInfo", cliq_args) diff --git a/cinder/volume/drivers/san/solaris.py b/cinder/volume/drivers/san/solaris.py index 8dce31d11bf..9a513265eb5 100644 --- a/cinder/volume/drivers/san/solaris.py +++ b/cinder/volume/drivers/san/solaris.py @@ -267,7 +267,7 @@ class SolarisISCSIDriver(SanISCSIDriver): self._execute('/usr/sbin/sbdadm', 'delete-lu', luid) def _collect_lines(self, data): - """Split lines from data into an array, trimming them """ + """Split lines from data into an array, trimming them.""" matches = [] for line in data.splitlines(): match = line.strip() @@ -275,7 +275,7 @@ class SolarisISCSIDriver(SanISCSIDriver): return matches def _get_prefixed_values(self, data, prefix): - """Collect lines which start with prefix; with trimming""" + """Collect lines which start with prefix; with trimming.""" matches = [] for line in data.splitlines(): line = line.strip() diff --git a/cinder/volume/drivers/sheepdog.py b/cinder/volume/drivers/sheepdog.py index 1168a6086ca..7e7678f5710 100644 --- a/cinder/volume/drivers/sheepdog.py +++ b/cinder/volume/drivers/sheepdog.py @@ -39,7 +39,7 @@ CONF.import_opt("image_conversion_dir", "cinder.image.image_utils") class SheepdogDriver(driver.VolumeDriver): - """Executes commands relating to Sheepdog Volumes""" + """Executes commands relating to Sheepdog Volumes.""" VERSION = "1.0.0" @@ -49,7 +49,7 @@ class SheepdogDriver(driver.VolumeDriver): self._stats = {} def check_for_setup_error(self): - """Returns an error if prerequisites aren't met""" + """Return error if prerequisites aren't met.""" try: #NOTE(francois-charlier) Since 0.24 'collie cluster info -r' # gives short output, but for compatibility reason we won't @@ -68,20 +68,20 @@ class SheepdogDriver(driver.VolumeDriver): raise NotImplementedError() def create_volume(self, volume): - """Creates a sheepdog volume""" + """Create a sheepdog volume.""" self._try_execute('qemu-img', 'create', "sheepdog:%s" % volume['name'], '%sG' % volume['size']) def create_volume_from_snapshot(self, volume, snapshot): - """Creates a sheepdog volume from a snapshot.""" + """Create a sheepdog volume from a snapshot.""" self._try_execute('qemu-img', 'create', '-b', "sheepdog:%s:%s" % (snapshot['volume_name'], snapshot['name']), "sheepdog:%s" % volume['name']) def delete_volume(self, volume): - """Deletes a logical volume""" + """Delete a logical volume.""" self._delete(volume) def _ensure_dir_exists(self, tmp_dir): @@ -117,12 +117,12 @@ class SheepdogDriver(driver.VolumeDriver): self._resize(volume) def create_snapshot(self, snapshot): - """Creates a sheepdog snapshot""" + """Create a sheepdog snapshot.""" self._try_execute('qemu-img', 'snapshot', '-c', snapshot['name'], "sheepdog:%s" % snapshot['volume_name']) def delete_snapshot(self, snapshot): - """Deletes a sheepdog snapshot""" + """Delete a sheepdog snapshot.""" self._try_execute('collie', 'vdi', 'delete', snapshot['volume_name'], '-s', snapshot['name']) @@ -130,15 +130,15 @@ class SheepdogDriver(driver.VolumeDriver): return "sheepdog:%s" % volume['name'] def ensure_export(self, context, volume): - """Safely and synchronously recreates an export for a logical volume""" + """Safely and synchronously recreate an export for a logical volume.""" pass def create_export(self, context, volume): - """Exports the volume""" + """Export a volume.""" pass def remove_export(self, context, volume): - """Removes an export for a logical volume""" + """Remove an export for a logical volume.""" pass def initialize_connection(self, volume, connector): diff --git a/cinder/volume/drivers/storwize_svc.py b/cinder/volume/drivers/storwize_svc.py index cca77b9d573..9900c47ec83 100644 --- a/cinder/volume/drivers/storwize_svc.py +++ b/cinder/volume/drivers/storwize_svc.py @@ -1809,7 +1809,7 @@ class StorwizeSVCDriver(san.SanDriver): class CLIResponse(object): - '''Parse SVC CLI output and generate iterable''' + '''Parse SVC CLI output and generate iterable.''' def __init__(self, raw, delim='!', with_header=True): super(CLIResponse, self).__init__() diff --git a/cinder/volume/drivers/vmware/read_write_util.py b/cinder/volume/drivers/vmware/read_write_util.py index b174ce04c44..2428d533b7c 100644 --- a/cinder/volume/drivers/vmware/read_write_util.py +++ b/cinder/volume/drivers/vmware/read_write_util.py @@ -304,7 +304,7 @@ class VMwareHTTPReadVmdk(VMwareHTTPFile): VMwareHTTPFile.__init__(self, conn) def read(self, chunk_size): - """Read a chunk from file""" + """Read a chunk from file.""" self._progress += READ_CHUNKSIZE LOG.debug(_("Read %s bytes from vmdk.") % self._progress) return self.file_handle.read(READ_CHUNKSIZE) diff --git a/cinder/volume/drivers/windows/windows_utils.py b/cinder/volume/drivers/windows/windows_utils.py index 938ac08f20f..caa64816ce7 100644 --- a/cinder/volume/drivers/windows/windows_utils.py +++ b/cinder/volume/drivers/windows/windows_utils.py @@ -131,7 +131,7 @@ class WindowsUtils(object): raise exception.VolumeBackendAPIException(data=err_msg) def create_volume(self, vhd_path, vol_name, vol_size): - """Creates a volume""" + """Creates a volume.""" try: cl = self._conn_wmi.__getattr__("WT_Disk") cl.NewWTDisk(DevicePath=vhd_path, @@ -247,7 +247,7 @@ class WindowsUtils(object): raise exception.VolumeBackendAPIException(data=err_msg) def add_disk_to_target(self, vol_name, target_name): - """Adds the disk to the target""" + """Adds the disk to the target.""" try: q = self._conn_wmi.WT_Disk(Description=vol_name) wt_disk = q[0] diff --git a/cinder/volume/drivers/xenapi/sm.py b/cinder/volume/drivers/xenapi/sm.py index f19d48054c9..463cb1d1d1d 100644 --- a/cinder/volume/drivers/xenapi/sm.py +++ b/cinder/volume/drivers/xenapi/sm.py @@ -125,7 +125,7 @@ class XenAPINFSDriver(driver.VolumeDriver): pass def check_for_setup_error(self): - """To override superclass' method""" + """To override superclass' method.""" def create_volume_from_snapshot(self, volume, snapshot): return self._copy_volume( diff --git a/cinder/volume/flows/create_volume/__init__.py b/cinder/volume/flows/create_volume/__init__.py index 7f3a6efa28a..fec3f18148b 100644 --- a/cinder/volume/flows/create_volume/__init__.py +++ b/cinder/volume/flows/create_volume/__init__.py @@ -997,7 +997,7 @@ class ExtractSchedulerSpecTask(base.CinderTask): class ExtractVolumeRefTask(base.CinderTask): - """Extracts volume reference for given volume id. """ + """Extracts volume reference for given volume id.""" default_provides = 'volume_ref' @@ -1273,7 +1273,7 @@ class CreateVolumeFromSpecTask(base.CinderTask): def _copy_image_to_volume(self, context, volume_ref, image_id, image_location, image_service): - """Downloads Glance image to the specified volume. """ + """Downloads Glance image to the specified volume.""" copy_image_to_volume = self.driver.copy_image_to_volume volume_id = volume_ref['id'] LOG.debug(_("Attempting download of %(image_id)s (%(image_location)s)" diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 88b6db220c8..626e6aa1c1c 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -537,7 +537,7 @@ class VolumeManager(manager.SchedulerDependentManager): @utils.require_driver_initialized def attach_volume(self, context, volume_id, instance_uuid, host_name, mountpoint, mode): - """Updates db to show volume is attached""" + """Updates db to show volume is attached.""" @utils.synchronized(volume_id, external=True) def do_attach(): # check the volume status before attaching @@ -612,7 +612,7 @@ class VolumeManager(manager.SchedulerDependentManager): @utils.require_driver_initialized def detach_volume(self, context, volume_id): - """Updates db to show volume is detached""" + """Updates db to show volume is detached.""" # TODO(vish): refactor this into a more general "unreserve" # TODO(sleepsonthefloor): Is this 'elevated' appropriate? diff --git a/tox.ini b/tox.ini index 9ce875eed58..d6958305878 100644 --- a/tox.ini +++ b/tox.ini @@ -43,6 +43,6 @@ commands = commands = {posargs} [flake8] -ignore = E711,E712,F401,F403,F841,H302,H303,H304,H402,H803 +ignore = E711,E712,F401,F403,F841,H302,H303,H304,H803 builtins = _ exclude = .git,.venv,.tox,dist,doc,common,*egg,build