From db4327b6fe81dc9099e6473e0220a04bae2a4a87 Mon Sep 17 00:00:00 2001 From: junboli Date: Mon, 10 Jul 2017 10:46:44 +0800 Subject: [PATCH] Keep consistent of naming convention In the project, some of the terminology, like URL, URLs, API, APIs, OpenStack, UUID, Cinder are neglectfully written as url, api, openstack, uuid, cinder. This patch is to keep consistent of naming convention. Change-Id: I98777fb4748cbc58b6e2fd1aca058d3e44069d07 --- api-ref/source/conf.py | 2 +- cinder/api/__init__.py | 2 +- cinder/api/common.py | 2 +- cinder/api/contrib/volume_actions.py | 2 +- cinder/api/v3/attachments.py | 6 +++--- cinder/api/v3/backups.py | 4 ++-- cinder/api/v3/consistencygroups.py | 2 +- cinder/api/v3/group_snapshots.py | 2 +- cinder/api/v3/snapshots.py | 2 +- cinder/backup/driver.py | 4 ++-- cinder/db/sqlalchemy/models.py | 2 +- cinder/exception.py | 2 +- cinder/volume/drivers/nimble.py | 2 +- cinder/volume/drivers/reduxio/rdx_iscsi_driver.py | 8 ++++---- cinder/volume/drivers/synology/synology_iscsi.py | 2 +- doc/source/conf.py | 2 +- doc/source/devref/api_microversion_dev.rst | 6 +++--- tools/generate_driver_list.py | 4 ++-- 18 files changed, 28 insertions(+), 28 deletions(-) diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 900cbb622f9..f5385d9bf04 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. # -# cinder documentation build configuration file, created by +# Cinder documentation build configuration file, created by # sphinx-quickstart on Sat May 1 15:17:47 2010. # # This file is execfile()d with the current directory set to diff --git a/cinder/api/__init__.py b/cinder/api/__init__.py index bef2621207c..22124ad6a31 100644 --- a/cinder/api/__init__.py +++ b/cinder/api/__init__.py @@ -26,7 +26,7 @@ LOG = logging.getLogger(__name__) def root_app_factory(loader, global_conf, **local_conf): if CONF.enable_v1_api: - LOG.warning('The v1 api is deprecated and is not under active ' + LOG.warning('The v1 API is deprecated and is not under active ' 'development. You should set enable_v1_api=false ' 'and enable_v3_api=true in your cinder.conf file.') return paste.urlmap.urlmap_factory(loader, global_conf, **local_conf) diff --git a/cinder/api/common.py b/cinder/api/common.py index 4065f0940aa..07376c14652 100644 --- a/cinder/api/common.py +++ b/cinder/api/common.py @@ -254,7 +254,7 @@ def get_request_url(request): def remove_version_from_href(href): - """Removes the first api version from the href. + """Removes the first API version from the href. Given: 'http://cinder.example.com/v1.1/123' Returns: 'http://cinder.example.com/123' diff --git a/cinder/api/contrib/volume_actions.py b/cinder/api/contrib/volume_actions.py index d6fd8254828..afe179a9e5d 100644 --- a/cinder/api/contrib/volume_actions.py +++ b/cinder/api/contrib/volume_actions.py @@ -61,7 +61,7 @@ class VolumeActionsController(wsgi.Controller): # Not found exception will be handled at the wsgi level volume = self.volume_api.get(context, id) - # instance uuid is an option now + # instance UUID is an option now instance_uuid = None if 'instance_uuid' in body['os-attach']: instance_uuid = body['os-attach']['instance_uuid'] diff --git a/cinder/api/v3/attachments.py b/cinder/api/v3/attachments.py index d7d0d34e2f3..37ca71c79d0 100644 --- a/cinder/api/v3/attachments.py +++ b/cinder/api/v3/attachments.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""The volumes attachments api.""" +"""The volumes attachments API.""" from oslo_log import log as logging import webob @@ -114,8 +114,8 @@ class AttachmentsController(wsgi.Controller): information (connector data) at the time of the call. NOTE: In Nova terms server == instance, the server_id parameter - referenced below is the uuid of the Instance, for non-nova consumers - this can be a server uuid or some other arbitrary unique identifier. + referenced below is the UUID of the Instance, for non-nova consumers + this can be a server UUID or some other arbitrary unique identifier. Expected format of the input parameter 'body': diff --git a/cinder/api/v3/backups.py b/cinder/api/v3/backups.py index 5793a4cadd9..c75308f5af0 100644 --- a/cinder/api/v3/backups.py +++ b/cinder/api/v3/backups.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""The backups V3 api.""" +"""The backups V3 API.""" from oslo_log import log as logging from webob import exc @@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__) class BackupsController(backups_v2.BackupsController): - """The backups API controller for the Openstack API V3.""" + """The backups API controller for the OpenStack API V3.""" @wsgi.Controller.api_version(BACKUP_UPDATE_MICRO_VERSION) def update(self, req, id, body): diff --git a/cinder/api/v3/consistencygroups.py b/cinder/api/v3/consistencygroups.py index b0e974e268e..a7e542293db 100644 --- a/cinder/api/v3/consistencygroups.py +++ b/cinder/api/v3/consistencygroups.py @@ -11,7 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""The consistencygroups V3 api.""" +"""The consistencygroups V3 API.""" from oslo_log import log as logging from six.moves import http_client diff --git a/cinder/api/v3/group_snapshots.py b/cinder/api/v3/group_snapshots.py index b5d8b454419..f1b18763a06 100644 --- a/cinder/api/v3/group_snapshots.py +++ b/cinder/api/v3/group_snapshots.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""The group_snapshots api.""" +"""The group_snapshots API.""" from oslo_log import log as logging import six diff --git a/cinder/api/v3/snapshots.py b/cinder/api/v3/snapshots.py index dc079868b53..025e74fe09c 100644 --- a/cinder/api/v3/snapshots.py +++ b/cinder/api/v3/snapshots.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""The volumes snapshots V3 api.""" +"""The volumes snapshots V3 API.""" import ast diff --git a/cinder/backup/driver.py b/cinder/backup/driver.py index 18450123234..0e65fce6423 100644 --- a/cinder/backup/driver.py +++ b/cinder/backup/driver.py @@ -87,11 +87,11 @@ class BackupMetadataAPI(base.Base): LOG.info("Unable to serialize field '%s' - excluding " "from backup", key) continue - # Copy the encryption key uuid for backup + # Copy the encryption key UUID for backup if key is 'encryption_key_id' and value is not None: km = key_manager.API(CONF) value = km.store(self.context, km.get(self.context, value)) - LOG.debug("Copying encryption key uuid for backup.") + LOG.debug("Copying encryption key UUID for backup.") container[type_tag][key] = value LOG.debug("Completed fetching metadata type '%s'", type_tag) diff --git a/cinder/db/sqlalchemy/models.py b/cinder/db/sqlalchemy/models.py index 52ede115889..1d1f2ab035f 100644 --- a/cinder/db/sqlalchemy/models.py +++ b/cinder/db/sqlalchemy/models.py @@ -818,7 +818,7 @@ class Message(BASE, CinderBase): message_level = Column(String(255), nullable=False) request_id = Column(String(255), nullable=True) resource_type = Column(String(255)) - # The uuid of the related resource. + # The UUID of the related resource. resource_uuid = Column(String(36), nullable=True) # Operation specific event ID. event_id = Column(String(255), nullable=False) diff --git a/cinder/exception.py b/cinder/exception.py index 5fa23003631..4516b35bf57 100644 --- a/cinder/exception.py +++ b/cinder/exception.py @@ -266,7 +266,7 @@ class SnapshotUnavailable(VolumeBackendAPIException): class InvalidUUID(Invalid): - message = _("Expected a uuid but received %(uuid)s.") + message = _("Expected a UUID but received %(uuid)s.") class InvalidAPIVersionString(Invalid): diff --git a/cinder/volume/drivers/nimble.py b/cinder/volume/drivers/nimble.py index 4e7229be366..6b3efa37a90 100644 --- a/cinder/volume/drivers/nimble.py +++ b/cinder/volume/drivers/nimble.py @@ -442,7 +442,7 @@ class NimbleBaseVolumeDriver(san.SanDriver): if 'access_control_records' in vol_info and ( vol_info['access_control_records'] is not None): msg = (_('Volume %s has ACL associated with it. Remove ACL ' - 'for managing using Openstack') % target_vol_name) + 'for managing using OpenStack') % target_vol_name) raise exception.InvalidVolume(reason=msg) data['data']['agent_type'] = AGENT_TYPE_OPENSTACK_GST else: diff --git a/cinder/volume/drivers/reduxio/rdx_iscsi_driver.py b/cinder/volume/drivers/reduxio/rdx_iscsi_driver.py index 712fd15637b..0f037333201 100644 --- a/cinder/volume/drivers/reduxio/rdx_iscsi_driver.py +++ b/cinder/volume/drivers/reduxio/rdx_iscsi_driver.py @@ -151,7 +151,7 @@ class ReduxioISCSIDriver(san.SanISCSIDriver): cli_vol = self.rdxApi.find_volume_by_name(target_vol_name) managed_info = self._get_managed_info(cli_vol) - # Check if volume is already managed by Openstack + # Check if volume is already managed by OpenStack if managed_info[AGENT_TYPE_KEY] == AGENT_TYPE_OPENSTACK: raise exception.ManageExistingAlreadyManaged( volume_ref=volume['id']) @@ -187,7 +187,7 @@ class ReduxioISCSIDriver(san.SanISCSIDriver): managed_info = self._get_managed_info(cli_vol) if managed_info['agent-type'] != AGENT_TYPE_OPENSTACK: - msg = _('Only volumes managed by Openstack can be unmanaged.') + msg = _('Only volumes managed by OpenStack can be unmanaged.') raise exception.InvalidVolume(reason=msg) # update the agent-type to None @@ -244,7 +244,7 @@ class ReduxioISCSIDriver(san.SanISCSIDriver): Reduxio CLI date: mm/dd/yyyy-hh:mm:ss. for example: '02/17/2015-11:39:00. Note: Different timezones might be configured - for Reduxio and Openstack. + for Reduxio and OpenStack. The specified date must be related to Reduxio time settings. If meta key 'backdate' was not specified, @@ -292,7 +292,7 @@ class ReduxioISCSIDriver(san.SanISCSIDriver): Reduxio CLI date: mm/dd/yyyy-hh:mm:ss. for example: '02/17/2015-11:39:00'. Note: Different timezones might be configured - for Reduxio and Openstack. + for Reduxio and OpenStack. The specified date must be related to Reduxio time settings. If meta key 'backdate' was not specified, then we create a snapshot diff --git a/cinder/volume/drivers/synology/synology_iscsi.py b/cinder/volume/drivers/synology/synology_iscsi.py index c102d9a723d..0b7a5e1da4e 100644 --- a/cinder/volume/drivers/synology/synology_iscsi.py +++ b/cinder/volume/drivers/synology/synology_iscsi.py @@ -25,7 +25,7 @@ LOG = logging.getLogger(__name__) @interface.volumedriver class SynoISCSIDriver(driver.ISCSIDriver): - """Openstack Cinder drivers for Synology storage. + """OpenStack Cinder drivers for Synology storage. Version history: 1.0.0 - Initial driver. Provide Cinder minimum features diff --git a/doc/source/conf.py b/doc/source/conf.py index c2e6957ee2d..960c97cf946 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -97,7 +97,7 @@ master_doc = 'index' repository_name = 'openstack/cinder' bug_project = 'cinder' bug_tag = 'doc' -project = u'cinder' +project = u'Cinder' copyright = u'2010-present, OpenStack Foundation' # The version info for the project you're documenting, acts as replacement for diff --git a/doc/source/devref/api_microversion_dev.rst b/doc/source/devref/api_microversion_dev.rst index a79c29c9fdc..e8970559c2c 100644 --- a/doc/source/devref/api_microversion_dev.rst +++ b/doc/source/devref/api_microversion_dev.rst @@ -36,12 +36,12 @@ changed. The user contract covers many kinds of information such as: - the Request - - the list of resource urls which exist on the server + - the list of resource URLs which exist on the server Example: adding a new shares/{ID}/foo which didn't exist in a previous version of the code - - the list of query parameters that are valid on urls + - the list of query parameters that are valid on URLs Example: adding a new parameter ``is_yellow`` servers/{ID}?is_yellow=True @@ -95,7 +95,7 @@ we need a microversion". new_param[shape="diamond", style="", label="Did we add or remove an accepted query string parameter or value?"]; new_resource[shape="diamond", style="", label="Did we add or remove a - resource url?"]; + resource URL?"]; no[shape="box", style=rounded, label="No microversion needed"]; diff --git a/tools/generate_driver_list.py b/tools/generate_driver_list.py index 0c5c00187e8..3285f2fffda 100755 --- a/tools/generate_driver_list.py +++ b/tools/generate_driver_list.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""Generate list of cinder drivers""" +"""Generate list of Cinder drivers""" import argparse import os @@ -120,7 +120,7 @@ def collect_driver_info(driver): def output_dict(): - """Output the results as a json dict.""" + """Output the results as a JSON dict.""" driver_list = [] drivers = util.get_volume_drivers()