From b6f9e6921a71b37ddc7b9c12a8c985227b32b4fe Mon Sep 17 00:00:00 2001 From: sparkliu Date: Wed, 16 Dec 2015 09:49:43 -0800 Subject: [PATCH] Change the format of some inconsistent docstring Replace all the ":return:" with ":returns:" Replace all the ":returns " wtih ":returns:" Replace all the ":returns :" with ":returns:" Add the changes for ":raise" also, change ":raise" to ":raise:" Change-Id: Ib29fbb583dc2dad5d084c44d4172d6ddfa5f7458 --- cinder/api/common.py | 2 +- cinder/backup/driver.py | 4 +-- cinder/backup/drivers/tsm.py | 12 ++++---- cinder/utils.py | 4 +-- cinder/volume/driver.py | 30 +++++++++---------- .../drivers/dell/dell_storagecenter_common.py | 14 ++++----- .../volume/drivers/dothill/dothill_common.py | 2 +- cinder/volume/drivers/emc/xtremio.py | 4 +-- cinder/volume/drivers/hitachi/hnas_backend.py | 24 +++++++-------- cinder/volume/drivers/hitachi/hnas_iscsi.py | 2 +- cinder/volume/drivers/hitachi/hnas_nfs.py | 4 +-- cinder/volume/drivers/hpe/hpe_3par_common.py | 10 +++---- .../drivers/ibm/storwize_svc/__init__.py | 2 +- .../drivers/infortrend/infortrend_fc_cli.py | 2 +- .../infortrend/infortrend_iscsi_cli.py | 2 +- cinder/volume/drivers/lvm.py | 2 +- .../volume/drivers/netapp/eseries/client.py | 8 ++--- .../volume/drivers/netapp/eseries/library.py | 8 ++--- cinder/volume/drivers/netapp/utils.py | 4 +-- cinder/volume/drivers/nfs.py | 2 +- cinder/volume/drivers/rbd.py | 2 +- cinder/volume/drivers/zfssa/zfssaiscsi.py | 2 +- cinder/volume/drivers/zfssa/zfssanfs.py | 2 +- .../brocade/brcd_fc_san_lookup_service.py | 6 ++-- .../cisco/cisco_fc_san_lookup_service.py | 6 ++-- cinder/zonemanager/fc_san_lookup_service.py | 4 +-- 26 files changed, 82 insertions(+), 82 deletions(-) diff --git a/cinder/api/common.py b/cinder/api/common.py index 0352ddd4a..c7fc51568 100644 --- a/cinder/api/common.py +++ b/cinder/api/common.py @@ -324,7 +324,7 @@ class ViewBuilder(object): items :param id_key: Attribute key used to retrieve the unique ID, used to generate the next link marker for a pagination query - :returns links + :returns: links """ item_count = item_count or len(items) limit = _get_limit_param(request.GET.copy()) diff --git a/cinder/backup/driver.py b/cinder/backup/driver.py index 37597ca74..df9e43634 100644 --- a/cinder/backup/driver.py +++ b/cinder/backup/driver.py @@ -360,7 +360,7 @@ class BackupDriver(base.Base): Default backup driver implementation has no extra information. :param backup: backup object to export - :returns driver_info - dictionary with extra information + :returns: driver_info - dictionary with extra information """ return {} @@ -378,7 +378,7 @@ class BackupDriver(base.Base): :param backup: backup object to export :param driver_info: dictionary with driver specific backup record information - :returns nothing + :returns: nothing """ return diff --git a/cinder/backup/drivers/tsm.py b/cinder/backup/drivers/tsm.py index 43b42478f..4d4991f7a 100644 --- a/cinder/backup/drivers/tsm.py +++ b/cinder/backup/drivers/tsm.py @@ -134,7 +134,7 @@ def _create_unique_device_link(backup_id, volume_path, volume_id, bckup_mode): :param volume_id: Volume id for backup or as restore target :param bckup_mode: TSM backup mode, either 'image' or 'file' :raises: InvalidBackup - :returns str -- hardlink path of the volume block device + :returns: str -- hardlink path of the volume block device """ if _image_mode(bckup_mode): hardlink_path = utils.make_dev_path('%s-%s' % @@ -165,7 +165,7 @@ def _check_dsmc_output(output, check_attrs, exact_match=True): value specified in check_attrs. This is needed because for file backups, the parent directories may also be included the first a volume is backed up. - :returns bool -- indicate if requited output attribute found in output + :returns: bool -- indicate if requited output attribute found in output """ parsed_attrs = {} @@ -195,8 +195,8 @@ def _get_volume_realpath(volume_file, volume_id): :param volume_file: file object representing the volume :param volume_id: Volume id for backup or as restore target :raises: InvalidBackup - :returns str -- real path of volume device - :returns str -- backup mode to be used + :returns: str -- real path of volume device + :returns: str -- backup mode to be used """ try: @@ -417,7 +417,7 @@ class TSMBackupDriver(driver.BackupDriver): :param backup: backup information for volume :param volume_id: volume id :param volume_file: file object representing the volume - :raises InvalidBackup + :raises: InvalidBackup """ # backup_path is the path that was originally backed up. @@ -476,7 +476,7 @@ class TSMBackupDriver(driver.BackupDriver): """Delete the given backup from TSM server. :param backup: backup information for volume - :raises InvalidBackup + :raises: InvalidBackup """ delete_attrs = {'Total number of objects deleted': '1'} diff --git a/cinder/utils.py b/cinder/utils.py index e2865a429..84b84d773 100644 --- a/cinder/utils.py +++ b/cinder/utils.py @@ -867,7 +867,7 @@ def trace(f): Using this decorator on a function will cause its execution to be logged at `DEBUG` level with arguments, return values, and exceptions. - :returns a function decorator + :returns: a function decorator """ func_name = f.__name__ @@ -968,7 +968,7 @@ def resolve_hostname(hostname): In this case, the same IP address will be returned. :param hostname: Host name to resolve. - :return: IP Address for Host name. + :returns: IP Address for Host name. """ result = socket.getaddrinfo(hostname, None)[0] (family, socktype, proto, canonname, sockaddr) = result diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 97817155a..7dd8b013e 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -522,7 +522,7 @@ class BaseVD(object): def get_prefixed_property(self, property): """Return prefixed property name - :return a prefixed property name string or None + :returns: a prefixed property name string or None """ if property and self.capabilities.get('vendor_prefix'): @@ -844,7 +844,7 @@ class BaseVD(object): find the default filter_function. When None is returned the scheduler will always pass the driver instance. - :return a filter_function string or None + :returns: a filter_function string or None """ ret_function = self.configuration.filter_function if not ret_function: @@ -861,7 +861,7 @@ class BaseVD(object): find the default goodness_function. When None is returned the scheduler will give the lowest score to the driver instance. - :return a goodness_function string or None + :returns: a goodness_function string or None """ ret_function = self.configuration.goodness_function if not ret_function: @@ -876,7 +876,7 @@ class BaseVD(object): Each driver could overwrite the method to return a well-known default string if it is available. - :return: None + :returns: None """ return None @@ -886,7 +886,7 @@ class BaseVD(object): Each driver could overwrite the method to return a well-known default string if it is available. - :return: None + :returns: None """ return None @@ -1302,7 +1302,7 @@ class BaseVD(object): :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ msg = _("The method update_migrated_volume is not implemented.") raise NotImplementedError(msg) @@ -1407,7 +1407,7 @@ class BaseVD(object): """Return pool name where volume reside on. :param volume: The volume hosted by the the driver. - :return: name of the pool where given volume is in. + :returns: name of the pool where given volume is in. """ return None @@ -1416,7 +1416,7 @@ class BaseVD(object): :param volumes: List of Cinder volumes to check for updates :param snapshots: List of Cinder snapshots to check for updates - :return: tuple (volume_updates, snapshot_updates) + :returns: tuple (volume_updates, snapshot_updates) where volume updates {'id': uuid, provider_id: } and snapshot updates {'id': uuid, provider_id: } @@ -2050,7 +2050,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, :param context: the context of the caller. :param group: the dictionary of the consistency group to be created. - :return model_update + :returns: model_update model_update will be in this format: {'status': xxx, ......}. @@ -2078,7 +2078,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, :param snapshots: a list of snapshot dictionaries in the cgsnapshot. :param source_cg: the dictionary of a consistency group as source. :param source_vols: a list of volume dictionaries in the source_cg. - :return model_update, volumes_model_update + :returns: model_update, volumes_model_update The source can be cgsnapshot or a source cg. @@ -2103,7 +2103,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, :param context: the context of the caller. :param group: the dictionary of the consistency group to be deleted. :param volumes: a list of volume dictionaries in the group. - :return model_update, volumes_model_update + :returns: model_update, volumes_model_update param volumes is retrieved directly from the db. It is a list of cinder.db.sqlalchemy.models.Volume to be precise. It cannot be @@ -2149,7 +2149,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, :param group: the dictionary of the consistency group to be updated. :param add_volumes: a list of volume dictionaries to be added. :param remove_volumes: a list of volume dictionaries to be removed. - :return model_update, add_volumes_update, remove_volumes_update + :returns: model_update, add_volumes_update, remove_volumes_update model_update is a dictionary that the driver wants the manager to update upon a successful return. If None is returned, the manager @@ -2175,7 +2175,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, :param context: the context of the caller. :param cgsnapshot: the dictionary of the cgsnapshot to be created. :param snapshots: a list of snapshot dictionaries in the cgsnapshot. - :return model_update, snapshots_model_update + :returns: model_update, snapshots_model_update param snapshots is retrieved directly from the db. It is a list of cinder.db.sqlalchemy.models.Snapshot to be precise. It cannot be @@ -2219,7 +2219,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, :param context: the context of the caller. :param cgsnapshot: the dictionary of the cgsnapshot to be deleted. :param snapshots: a list of snapshot dictionaries in the cgsnapshot. - :return model_update, snapshots_model_update + :returns: model_update, snapshots_model_update param snapshots is retrieved directly from the db. It is a list of cinder.db.sqlalchemy.models.Snapshot to be precise. It cannot be @@ -2265,7 +2265,7 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD, """Return pool name where volume reside on. :param volume: The volume hosted by the the driver. - :return: name of the pool where given volume is in. + :returns: name of the pool where given volume is in. """ return None diff --git a/cinder/volume/drivers/dell/dell_storagecenter_common.py b/cinder/volume/drivers/dell/dell_storagecenter_common.py index 84008ac85..36399149e 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_common.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_common.py @@ -106,7 +106,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, :param api: Dell SC API opbject. :param scvolume: Dell SC Volume object. :param volume: Cinder Volume object. - :return: Nothing. + :returns: Nothing. """ if scvolume and volume.get('consistencygroup_id'): profile = api.find_replay_profile( @@ -389,7 +389,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ # We use id as our volume name so we need to rename the backend # volume to the original volume name. @@ -417,7 +417,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, :param context: the context of the caller. :param group: the dictionary of the consistency group to be created. - :return: Nothing on success. + :returns: Nothing on success. :raises: VolumeBackendAPIException """ gid = group['id'] @@ -434,7 +434,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, :param context: the context of the caller. :param group: the dictionary of the consistency group to be created. - :return: Updated model_update, volumes. + :returns: Updated model_update, volumes. """ gid = group['id'] with self._client.open_connection() as api: @@ -463,7 +463,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, :param group: the dictionary of the consistency group to be updated. :param add_volumes: a list of volume dictionaries to be added. :param remove_volumes: a list of volume dictionaries to be removed. - :return model_update, add_volumes_update, remove_volumes_update + :returns: model_update, add_volumes_update, remove_volumes_update model_update is a dictionary that the driver wants the manager to update upon a successful return. If None is returned, the manager @@ -501,7 +501,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, :param context: the context of the caller. :param cgsnapshot: Information about the snapshot to take. - :return: Updated model_update, snapshots. + :returns: Updated model_update, snapshots. :raises: VolumeBackendAPIException. """ cgid = cgsnapshot['consistencygroup_id'] @@ -537,7 +537,7 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, :param context: the context of the caller. :param cgsnapshot: Information about the snapshot to delete. - :return: Updated model_update, snapshots. + :returns: Updated model_update, snapshots. :raises: VolumeBackendAPIException. """ cgid = cgsnapshot['consistencygroup_id'] diff --git a/cinder/volume/drivers/dothill/dothill_common.py b/cinder/volume/drivers/dothill/dothill_common.py index cfa28019f..4c1e7b85a 100644 --- a/cinder/volume/drivers/dothill/dothill_common.py +++ b/cinder/volume/drivers/dothill/dothill_common.py @@ -446,7 +446,7 @@ class DotHillCommon(object): :param host: A dictionary describing the host to migrate to, where host['host'] is its name, and host['capabilities'] is a dictionary of its reported capabilities. - :returns (False, None) if the driver does not support migration, + :returns: (False, None) if the driver does not support migration, (True, None) if successful """ diff --git a/cinder/volume/drivers/emc/xtremio.py b/cinder/volume/drivers/emc/xtremio.py index aacc6ad27..c7da071b9 100644 --- a/cinder/volume/drivers/emc/xtremio.py +++ b/cinder/volume/drivers/emc/xtremio.py @@ -616,7 +616,7 @@ class XtremIOVolumeDriver(san.SanDriver): :param volumes: a list of volume dictionaries in the group. :param cgsnapshot: the dictionary of the cgsnapshot as source. :param snapshots: a list of snapshot dictionaries in the cgsnapshot. - :return model_update, volumes_model_update + :returns: model_update, volumes_model_update """ if cgsnapshot and snapshots: snap_by_anc = self.get_snapset_ancestors(cgsnapshot) @@ -642,7 +642,7 @@ class XtremIOVolumeDriver(san.SanDriver): :param group: the dictionary of the consistency group to be updated. :param add_volumes: a list of volume dictionaries to be added. :param remove_volumes: a list of volume dictionaries to be removed. - :return model_update, add_volumes_update, remove_volumes_update + :returns: model_update, add_volumes_update, remove_volumes_update """ add_volumes = add_volumes if add_volumes else [] remove_volumes = remove_volumes if remove_volumes else [] diff --git a/cinder/volume/drivers/hitachi/hnas_backend.py b/cinder/volume/drivers/hitachi/hnas_backend.py index ac841924a..0e4688e21 100644 --- a/cinder/volume/drivers/hitachi/hnas_backend.py +++ b/cinder/volume/drivers/hitachi/hnas_backend.py @@ -49,7 +49,7 @@ class HnasBackend(object): :param ip0: string IP address of controller :param user: string user authentication for array :param pw: string password authentication for array - :return: formated string with version information + :returns: formated string with version information """ LOG.debug('Enable ssh: %s', six.text_type(self.drv_configs['ssh_enabled'])) @@ -122,7 +122,7 @@ class HnasBackend(object): :param ip0: string IP address of controller :param user: string user authentication for array :param pw: string password authentication for array - :return: formated string with version information + :returns: formated string with version information """ if (self.drv_configs['ssh_enabled'] == 'True' and self.drv_configs['cluster_admin_ip0'] is not None): @@ -160,7 +160,7 @@ class HnasBackend(object): :param ip0: string IP address of controller :param user: string user authentication for array :param pw: string password authentication for array - :return: formated string with iSCSI information + :returns: formated string with iSCSI information """ out, err = self.run_cmd(cmd, ip0, user, pw, @@ -188,7 +188,7 @@ class HnasBackend(object): :param user: string user authentication for array :param pw: string password authentication for array :param fslabel: filesystem label we want to get info - :return: formated string with filesystems and fsids + :returns: formated string with filesystems and fsids """ if fslabel is None: @@ -251,7 +251,7 @@ class HnasBackend(object): :param ip0: string IP address of controller :param user: string user authentication for array :param pw: string password authentication for array - :return: EVS id of the file system + :returns: EVS id of the file system """ out, err = self.run_cmd(cmd, ip0, user, pw, "evsfs", "list", @@ -618,7 +618,7 @@ class HnasBackend(object): :param evsid: EVSID for the file system :param iqn: iSCSI qualified name :param hlun: logical unit id - :return: formated string + :returns: formated string """ out, err = self.run_cmd(cmd, ip0, user, pw, "console-context", @@ -665,7 +665,7 @@ class HnasBackend(object): :param targetalias: alias of the target :param hdp: data pool of the logical unit :param secret: CHAP secret of the target - :return: string with full IQN + :returns: string with full IQN """ _evsid = self.get_evs(cmd, ip0, user, pw, hdp) @@ -774,8 +774,8 @@ class HnasBackend(object): :param pw: string password authentication for array :param hdp: pool name used :param target_alias: alias of the target - :return True if target exists - :return list with the target info + :returns: True if target exists + :returns: list with the target info """ LOG.debug("Checking if target %(tgt)s exists.", {'tgt': target_alias}) @@ -801,9 +801,9 @@ class HnasBackend(object): :param pw: string password authentication for array :param volume_name: number of the LUN :param hdp: storage pool of the LUN - :return True if the lun is attached - :return the LUN id - :return Info related to the target + :returns: True if the lun is attached + :returns: the LUN id + :returns: Info related to the target """ LOG.debug("Checking if vol %s (hdp: %s) is attached.", diff --git a/cinder/volume/drivers/hitachi/hnas_iscsi.py b/cinder/volume/drivers/hitachi/hnas_iscsi.py index f38f6ccaf..39a3297cb 100644 --- a/cinder/volume/drivers/hitachi/hnas_iscsi.py +++ b/cinder/volume/drivers/hitachi/hnas_iscsi.py @@ -226,7 +226,7 @@ class HDSISCSIDriver(driver.ISCSIDriver): Get the available service parametersfor a given volume using its type. :param volume: dictionary volume reference - :return HDP related to the service + :returns: HDP related to the service """ label = utils.extract_host(volume['host'], level='pool') diff --git a/cinder/volume/drivers/hitachi/hnas_nfs.py b/cinder/volume/drivers/hitachi/hnas_nfs.py index 94a42bd49..1edaed311 100644 --- a/cinder/volume/drivers/hitachi/hnas_nfs.py +++ b/cinder/volume/drivers/hitachi/hnas_nfs.py @@ -588,7 +588,7 @@ class HDSNFSDriver(nfs.NfsDriver): Convert that to an IP address and then restore the entire path. :param vol_ref: driver-specific information used to identify a volume - :return: a volume reference where share is in IP format + :returns: a volume reference where share is in IP format """ # First strip out share and convert to IP format. @@ -615,7 +615,7 @@ class HDSNFSDriver(nfs.NfsDriver): if unsuccessful. :param vol_ref: driver-specific information used to identify a volume - :return: NFS Share, NFS mount, volume path or raise error + :returns: NFS Share, NFS mount, volume path or raise error """ # Check that the reference is valid. if 'source-name' not in vol_ref: diff --git a/cinder/volume/drivers/hpe/hpe_3par_common.py b/cinder/volume/drivers/hpe/hpe_3par_common.py index 401128ed0..d33c59b3c 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_common.py +++ b/cinder/volume/drivers/hpe/hpe_3par_common.py @@ -1307,7 +1307,7 @@ class HPE3PARCommon(object): :param persona_value: :raises: exception.InvalidInput - :return: persona ID + :returns: persona ID """ if persona_value not in self.valid_persona_values: err = (_("Must specify a valid persona %(valid)s," @@ -1361,7 +1361,7 @@ class HPE3PARCommon(object): :param type_id: id of type to get settings for :param pool: CPG to use if type does not have one set - :return: dict + :returns: dict """ hpe3par_keys, qos, volume_type, vvs_name = self.get_type_info(type_id) @@ -1439,7 +1439,7 @@ class HPE3PARCommon(object): :param volume: :param host: Optional host to use for default pool. - :return: dict + :returns: dict """ type_id = volume.get('volume_type_id', None) @@ -1587,7 +1587,7 @@ class HPE3PARCommon(object): :param volume_host: The volume's host string. :param cpg: The actual pool (cpg) used, for example from the type. - :return: dict Model update if we need to update volume host, else None + :returns: dict Model update if we need to update volume host, else None """ model_update = None host = volume_utils.extract_host(volume_host, 'backend') @@ -1897,7 +1897,7 @@ class HPE3PARCommon(object): :param host: A dictionary describing the host to migrate to, where host['host'] is its name, and host['capabilities'] is a dictionary of its reported capabilities. - :returns (False, None) if the driver does not support migration, + :returns: (False, None) if the driver does not support migration, (True, model_update) if successful """ diff --git a/cinder/volume/drivers/ibm/storwize_svc/__init__.py b/cinder/volume/drivers/ibm/storwize_svc/__init__.py index e341ff72c..d70109c10 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/__init__.py +++ b/cinder/volume/drivers/ibm/storwize_svc/__init__.py @@ -940,7 +940,7 @@ class StorwizeSVCDriver(san.SanDriver, :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ current_name = CONF.volume_name_template % new_volume['id'] original_volume_name = CONF.volume_name_template % volume['id'] diff --git a/cinder/volume/drivers/infortrend/infortrend_fc_cli.py b/cinder/volume/drivers/infortrend/infortrend_fc_cli.py index d4da587f3..c783ad03c 100644 --- a/cinder/volume/drivers/infortrend/infortrend_fc_cli.py +++ b/cinder/volume/drivers/infortrend/infortrend_fc_cli.py @@ -271,7 +271,7 @@ class InfortrendCLIFCDriver(driver.FibreChannelDriver): :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ LOG.debug( 'update migrated volume original volume id= %(volume_id)s ' diff --git a/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py b/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py index 18ba89392..3430047e5 100644 --- a/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py +++ b/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py @@ -243,7 +243,7 @@ class InfortrendCLIISCSIDriver(driver.ISCSIDriver): :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ LOG.debug( 'update migrated volume original volume id= %(volume_id)s ' diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 0c1d2d1a2..61228ff6a 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -345,7 +345,7 @@ class LVMVolumeDriver(driver.VolumeDriver): :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ name_id = None provider_location = None diff --git a/cinder/volume/drivers/netapp/eseries/client.py b/cinder/volume/drivers/netapp/eseries/client.py index 60897216b..a06e56b42 100644 --- a/cinder/volume/drivers/netapp/eseries/client.py +++ b/cinder/volume/drivers/netapp/eseries/client.py @@ -174,7 +174,7 @@ class RestClient(WebserviceClient): :param version: The version to validate :param actual_version: The running version of the Webservice - :return: True if the actual_version is equal or newer than the + :returns: True if the actual_version is equal or newer than the current running version, otherwise False """ major_1, major_2, release, minor = version @@ -316,7 +316,7 @@ class RestClient(WebserviceClient): explicitly disable it. :param flash_cache: If true, add the volume to a Flash Cache :param data_assurance: If true, enable the Data Assurance capability - :return The created volume + :returns: The created volume """ # Utilize the new API if it is available @@ -371,8 +371,8 @@ class RestClient(WebserviceClient): """Retrieve the given volume from array. :param object_id: The volume id, label, or wwn - :return The volume identified by object_id - :raise VolumeNotFound if the volume could not be found + :returns: The volume identified by object_id + :raise: VolumeNotFound if the volume could not be found """ if self.features.SSC_API_V2: diff --git a/cinder/volume/drivers/netapp/eseries/library.py b/cinder/volume/drivers/netapp/eseries/library.py index dc5d0e206..86fedd25c 100644 --- a/cinder/volume/drivers/netapp/eseries/library.py +++ b/cinder/volume/drivers/netapp/eseries/library.py @@ -260,7 +260,7 @@ class NetAppESeriesLibrary(object): Example: (invalid, True) - :returns (str, bool) + :returns: (str, bool) """ status = system.get('passwordStatus') @@ -283,7 +283,7 @@ class NetAppESeriesLibrary(object): Example: (needsAttn, True) - :returns (str, bool) + :returns: (str, bool) """ status = system.get('status') status = status.lower() if status else '' @@ -387,7 +387,7 @@ class NetAppESeriesLibrary(object): """Return pool name where volume resides. :param volume: The volume hosted by the driver. - :return: Name of the pool where given volume is hosted. + :returns: Name of the pool where given volume is hosted. """ eseries_volume = self._get_volume(volume['name_id']) storage_pool = self._client.get_storage_pool( @@ -1264,7 +1264,7 @@ class NetAppESeriesLibrary(object): :param pool_id: The id of a storage pool :param action: The anticipated action - :return: A tuple (bool, set(str), int) + :returns: A tuple (bool, set(str), int) """ actions = set() eta = 0 diff --git a/cinder/volume/drivers/netapp/utils.py b/cinder/volume/drivers/netapp/utils.py index 60a6f4450..0c1c7c0fc 100644 --- a/cinder/volume/drivers/netapp/utils.py +++ b/cinder/volume/drivers/netapp/utils.py @@ -244,7 +244,7 @@ def get_pool_name_filter_regex(configuration): :param configuration: The volume driver configuration :raise InvalidConfigurationValue: if configured regex pattern is invalid - :return: A compiled regex for filtering pool names + :returns: A compiled regex for filtering pool names """ # If the configuration parameter is specified as an empty string @@ -487,6 +487,6 @@ class FeatureState(object): def __nonzero__(self): """Allow a FeatureState object to be tested for truth value - :return True if the feature is supported, otherwise False + :returns: True if the feature is supported, otherwise False """ return self.supported diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index aff48ee45..0ebc4c3ef 100644 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -394,7 +394,7 @@ class NfsDriver(driver.ExtendVD, remotefs.RemoteFSDriver): :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ # TODO(vhou) This method may need to be updated after # NFS snapshots are introduced. diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 6dc66aca0..c1baca5b0 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -1057,7 +1057,7 @@ class RBDDriver(driver.TransferVD, driver.ExtendVD, :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ name_id = None provider_location = None diff --git a/cinder/volume/drivers/zfssa/zfssaiscsi.py b/cinder/volume/drivers/zfssa/zfssaiscsi.py index 127c22a27..edeb4a833 100644 --- a/cinder/volume/drivers/zfssa/zfssaiscsi.py +++ b/cinder/volume/drivers/zfssa/zfssaiscsi.py @@ -904,7 +904,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver): :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ lcfg = self.configuration diff --git a/cinder/volume/drivers/zfssa/zfssanfs.py b/cinder/volume/drivers/zfssa/zfssanfs.py index 2ba106017..0b07060bc 100644 --- a/cinder/volume/drivers/zfssa/zfssanfs.py +++ b/cinder/volume/drivers/zfssa/zfssanfs.py @@ -615,7 +615,7 @@ class ZFSSANFSDriver(nfs.NfsDriver): :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume - :return model_update to update DB with any needed changes + :returns: model_update to update DB with any needed changes """ original_name = CONF.volume_name_template % volume['id'] diff --git a/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py b/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py index 3e4059963..56a88c9c3 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py +++ b/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py @@ -71,7 +71,7 @@ class BrcdFCSanLookupService(fc_service.FCSanLookupService): :param initiator_wwn_list: List of initiator port WWN :param target_wwn_list: List of target port WWN - :returns List -- device wwn map in following format + :returns: List -- device wwn map in following format { : { 'initiator_port_wwn_list': @@ -80,7 +80,7 @@ class BrcdFCSanLookupService(fc_service.FCSanLookupService): ('100000051e55a100', '100000051e55a121'..) } } - :raises Exception when connection to fabric is failed + :raises: Exception when connection to fabric is failed """ device_map = {} formatted_target_list = [] @@ -221,7 +221,7 @@ class BrcdFCSanLookupService(fc_service.FCSanLookupService): Parses nameserver raw data and adds the device port wwns to the list - :returns list of device port wwn from ns info + :returns: list of device port wwn from ns info """ nsinfo_list = [] lines = switch_data.split('\n') diff --git a/cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py b/cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py index 8db7743d2..ec89eb117 100644 --- a/cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py +++ b/cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py @@ -82,7 +82,7 @@ class CiscoFCSanLookupService(fc_service.FCSanLookupService): :param initiator_wwn_list: List of initiator port WWN :param target_wwn_list: List of target port WWN - :returns List -- device wwn map in following format + :returns: List -- device wwn map in following format { : { 'initiator_port_wwn_list': @@ -91,7 +91,7 @@ class CiscoFCSanLookupService(fc_service.FCSanLookupService): ('100000051e55a100', '100000051e55a121'..) } } - :raises Exception when connection to fabric is failed + :raises: Exception when connection to fabric is failed """ device_map = {} formatted_target_list = [] @@ -209,7 +209,7 @@ class CiscoFCSanLookupService(fc_service.FCSanLookupService): Parses nameserver raw data and adds the device port wwns to the list - :returns list of device port wwn from ns info + :returns: list of device port wwn from ns info """ nsinfo_list = [] for line in switch_data: diff --git a/cinder/zonemanager/fc_san_lookup_service.py b/cinder/zonemanager/fc_san_lookup_service.py index bbb2122c1..b83a5bc8a 100644 --- a/cinder/zonemanager/fc_san_lookup_service.py +++ b/cinder/zonemanager/fc_san_lookup_service.py @@ -59,7 +59,7 @@ class FCSanLookupService(fc_common.FCCommon): available. :param initiator_list list of initiator port WWN :param target_list list of target port WWN - :return device wwn map in following format + :returns: device wwn map in following format { : { 'initiator_port_wwn_list': @@ -68,7 +68,7 @@ class FCSanLookupService(fc_common.FCCommon): ('100000051E55A100', '100000051E55A121'..) } } - :raise Exception when a lookup service implementation is not specified + :raise: Exception when a lookup service implementation is not specified in cinder.conf:fc_san_lookup_service """ # Initialize vendor specific implementation of FCZoneDriver -- 2.45.2