From ab1b029ef798bd2915f782b7d96c2a48a95336f6 Mon Sep 17 00:00:00 2001 From: TommyLike Date: Tue, 18 Jul 2017 17:13:38 +0800 Subject: [PATCH] [DOC BLD FIX] Fix code block issues For json code block, correct format issues of the content, and for others use 'code-block: default' to avoid warnings. Change-Id: I94b4f513900fcb36ec55777a0762eba786ce1d7d --- cinder/api/common.py | 2 +- cinder/api/contrib/snapshot_manage.py | 5 +- cinder/api/contrib/volume_manage.py | 9 +- .../openstack/rest_api_version_history.rst | 94 ++++++++++--------- cinder/api/v3/attachments.py | 6 +- cinder/api/v3/views/resource_filters.py | 4 +- cinder/volume/driver.py | 20 ++-- cinder/volume/drivers/dell_emc/vmax/iscsi.py | 16 ++-- cinder/volume/drivers/hitachi/hbsd_common.py | 4 +- cinder/volume/drivers/hpe/hpe_3par_iscsi.py | 4 +- .../drivers/infortrend/infortrend_fc_cli.py | 2 +- .../infortrend/infortrend_iscsi_cli.py | 2 +- .../drivers/netapp/dataontap/block_base.py | 10 +- cinder/volume/drivers/vmware/vmdk.py | 6 +- cinder/volume/volume_types.py | 2 +- .../brocade/brcd_fc_san_lookup_service.py | 2 +- 16 files changed, 100 insertions(+), 88 deletions(-) diff --git a/cinder/api/common.py b/cinder/api/common.py index 4065f0940aa..3638ea43093 100644 --- a/cinder/api/common.py +++ b/cinder/api/common.py @@ -433,7 +433,7 @@ def get_enabled_resource_filters(resource=None): .. code-block:: json { - "resource": ['filter1', 'filter2', 'filter3'] + "resource": ["filter1", "filter2", "filter3"] } if resource is not specified, all of the configuration will be returned, diff --git a/cinder/api/contrib/snapshot_manage.py b/cinder/api/contrib/snapshot_manage.py index bf9f583df38..842156996f6 100644 --- a/cinder/api/contrib/snapshot_manage.py +++ b/cinder/api/contrib/snapshot_manage.py @@ -60,8 +60,9 @@ class SnapshotManageController(wsgi.Controller): { "snapshot": { - "volume_id": , - "ref": + "volume_id": "", + "ref": + "" } } diff --git a/cinder/api/contrib/volume_manage.py b/cinder/api/contrib/volume_manage.py index 0337323a77d..99ff0377832 100644 --- a/cinder/api/contrib/volume_manage.py +++ b/cinder/api/contrib/volume_manage.py @@ -62,11 +62,10 @@ class VolumeManageController(wsgi.Controller): .. code-block:: json { - 'volume': - { - 'host': , - 'cluster': , - 'ref': , + "volume": { + "host": "", + "cluster": "", + "ref": "" } } diff --git a/cinder/api/openstack/rest_api_version_history.rst b/cinder/api/openstack/rest_api_version_history.rst index 40d6c2f56d2..5f9e965d651 100644 --- a/cinder/api/openstack/rest_api_version_history.rst +++ b/cinder/api/openstack/rest_api_version_history.rst @@ -81,16 +81,18 @@ user documentation. .. code-block:: json - "cluster": { - "created_at": ..., - "disabled_reason": null, - "last_heartbeat": ..., - "name": "cluster_name", - "num_down_hosts": 4, - "num_hosts": 2, - "state": "up", - "status": "enabled", - "updated_at": ... + { + "cluster": { + "created_at": "", + "disabled_reason": null, + "last_heartbeat": "", + "name": "cluster_name", + "num_down_hosts": 4, + "num_hosts": 2, + "state": "up", + "status": "enabled", + "updated_at": "" + } } Update endpoint allows enabling and disabling a cluster in a similar way to @@ -100,11 +102,13 @@ user documentation. .. code-block:: json - "cluster": { - "name": "cluster_name", - "state": "up", - "status": "enabled" - "disabled_reason": null + { + "cluster": { + "name": "cluster_name", + "state": "up", + "status": "enabled", + "disabled_reason": null + } } Index and detail accept filtering by `name`, `binary`, `disabled`, @@ -115,37 +119,35 @@ user documentation. .. code-block:: json - "clusters": [ - { - "name": "cluster_name", - "state": "up", - "status": "enabled" - }, - { - ... - } - ] + { + "clusters": [ + { + "name": "cluster_name", + "state": "up", + "status": "enabled" + } + ] + } Detail endpoint returns: .. code-block:: json - "clusters": [ - { - "created_at": ..., - "disabled_reason": null, - "last_heartbeat": ..., - "name": "cluster_name", - "num_down_hosts": 4, - "num_hosts": 2, - "state": "up", - "status": "enabled", - "updated_at": ... - }, - { - ... - } - ] + { + "clusters": [ + { + "created_at": "", + "disabled_reason": null, + "last_heartbeat": "", + "name": "cluster_name", + "num_down_hosts": 4, + "num_hosts": 2, + "state": "up", + "status": "enabled", + "updated_at": "" + } + ] + } 3.8 --- @@ -160,10 +162,12 @@ user documentation. .. code-block:: json - "backup": { - "id": "backup_id", - "name": "backup_name", - "links": "backup_link", + { + "backup": { + "id": "backup_id", + "name": "backup_name", + "links": "backup_link" + } } 3.10 diff --git a/cinder/api/v3/attachments.py b/cinder/api/v3/attachments.py index d7d0d34e2f3..386626ecd60 100644 --- a/cinder/api/v3/attachments.py +++ b/cinder/api/v3/attachments.py @@ -126,7 +126,7 @@ class AttachmentsController(wsgi.Controller): { "volume_uuid": "volume-uuid", "instance_uuid": "nova-server-uuid", - "connector": None|, + "connector": "null|" } } @@ -142,9 +142,9 @@ class AttachmentsController(wsgi.Controller): "platform": "x86_64", "host": "tempest-1", "os_type": "linux2", - "multipath": False, + "multipath": false, "mountpoint": "/dev/vdb", - "mode": None|"rw"|"ro", + "mode": "null|rw|ro" } } diff --git a/cinder/api/v3/views/resource_filters.py b/cinder/api/v3/views/resource_filters.py index 9376c841988..7450b66842c 100644 --- a/cinder/api/v3/views/resource_filters.py +++ b/cinder/api/v3/views/resource_filters.py @@ -24,8 +24,8 @@ class ViewBuilder(object): { "resource_filters": [{ - "resource": 'resource_1', - "filters": ['filter1', 'filter2', 'filter3'] + "resource": "resource_1", + "filters": ["filter1", "filter2", "filter3"] }] } """ diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 01a21c8608c..38e5275615c 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -2716,16 +2716,16 @@ class ISERDriver(ISCSIDriver): The format of the driver data is defined in _get_iser_properties. Example return value: - .. code-block:: json + .. code-block:: default { - 'driver_volume_type': 'iser' + 'driver_volume_type': 'iser', 'data': { 'target_discovered': True, 'target_iqn': 'iqn.2010-10.org.iser.openstack:volume-00000001', 'target_portal': '127.0.0.0.1:3260', - 'volume_id': 1, + 'volume_id': 1 } } @@ -2764,27 +2764,29 @@ class FibreChannelDriver(VolumeDriver): correspond to the list of remote wwn(s) that will export the volume. Example return values: - .. code-block:: json + .. code-block:: default { - 'driver_volume_type': 'fibre_channel' + 'driver_volume_type': 'fibre_channel', 'data': { 'target_discovered': True, 'target_lun': 1, 'target_wwn': '1234567890123', - 'discard': False, + 'discard': False } } - or + or + + .. code-block:: default { - 'driver_volume_type': 'fibre_channel' + 'driver_volume_type': 'fibre_channel', 'data': { 'target_discovered': True, 'target_lun': 1, 'target_wwn': ['1234567890123', '0987654321321'], - 'discard': False, + 'discard': False } } diff --git a/cinder/volume/drivers/dell_emc/vmax/iscsi.py b/cinder/volume/drivers/dell_emc/vmax/iscsi.py index 555167efa9c..26eb485d68f 100644 --- a/cinder/volume/drivers/dell_emc/vmax/iscsi.py +++ b/cinder/volume/drivers/dell_emc/vmax/iscsi.py @@ -196,26 +196,30 @@ class VMAXISCSIDriver(driver.ISCSIDriver): the format of the driver data is defined in smis_get_iscsi_properties. Example return value: - .. code-block:: json + .. code-block:: default { - 'driver_volume_type': 'iscsi' + 'driver_volume_type': 'iscsi', 'data': { 'target_discovered': True, 'target_iqn': 'iqn.2010-10.org.openstack:volume-00000001', 'target_portal': '127.0.0.0.1:3260', - 'volume_id': '12345678-1234-4321-1234-123456789012', + 'volume_id': '12345678-1234-4321-1234-123456789012' } } - Example return value (multipath is enabled):: + + Example return value (multipath is enabled): + + .. code-block:: default + { - 'driver_volume_type': 'iscsi' + 'driver_volume_type': 'iscsi', 'data': { 'target_discovered': True, 'target_iqns': ['iqn.2010-10.org.openstack:volume-00001', 'iqn.2010-10.org.openstack:volume-00002'], 'target_portals': ['127.0.0.1:3260', '127.0.1.1:3260'], - 'target_luns': [1, 1], + 'target_luns': [1, 1] } } :param volume: the cinder volume object diff --git a/cinder/volume/drivers/hitachi/hbsd_common.py b/cinder/volume/drivers/hitachi/hbsd_common.py index f49886293cb..574ce3d333a 100644 --- a/cinder/volume/drivers/hitachi/hbsd_common.py +++ b/cinder/volume/drivers/hitachi/hbsd_common.py @@ -750,7 +750,7 @@ class HBSDCommon(object): For HUS 100 Family: - .. code-block:: json + .. code-block:: default { 'ldev': , @@ -759,7 +759,7 @@ class HBSDCommon(object): For VSP G1000/VSP/HUS VM: - .. code-block:: json + .. code-block:: default { 'ldev': , diff --git a/cinder/volume/drivers/hpe/hpe_3par_iscsi.py b/cinder/volume/drivers/hpe/hpe_3par_iscsi.py index 872a4fcf8c4..b38c87a38cb 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_iscsi.py +++ b/cinder/volume/drivers/hpe/hpe_3par_iscsi.py @@ -331,10 +331,10 @@ class HPE3PARISCSIDriver(driver.ManageableVD, The format of the driver data is defined in _get_iscsi_properties. Example return value: - .. code-block:: json + .. code-block:: default { - 'driver_volume_type': 'iscsi' + 'driver_volume_type': 'iscsi', 'data': { 'encrypted': False, 'target_discovered': True, diff --git a/cinder/volume/drivers/infortrend/infortrend_fc_cli.py b/cinder/volume/drivers/infortrend/infortrend_fc_cli.py index bebee7cf217..55b6e36e990 100644 --- a/cinder/volume/drivers/infortrend/infortrend_fc_cli.py +++ b/cinder/volume/drivers/infortrend/infortrend_fc_cli.py @@ -221,7 +221,7 @@ class InfortrendCLIFCDriver(driver.FibreChannelDriver): volume['name'] which is how drivers traditionally map between a cinder volume and the associated backend storage object. - .. code-block:: json + .. code-block:: default existing_ref:{ 'id':lun_id diff --git a/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py b/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py index 0b243681e21..246c452e9cd 100644 --- a/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py +++ b/cinder/volume/drivers/infortrend/infortrend_iscsi_cli.py @@ -194,7 +194,7 @@ class InfortrendCLIISCSIDriver(driver.ISCSIDriver): volume['name'] which is how drivers traditionally map between a cinder volume and the associated backend storage object. - .. code-block:: json + .. code-block:: default existing_ref:{ 'id':lun_id diff --git a/cinder/volume/drivers/netapp/dataontap/block_base.py b/cinder/volume/drivers/netapp/dataontap/block_base.py index 3321fc0fff0..9a035ca6fba 100644 --- a/cinder/volume/drivers/netapp/dataontap/block_base.py +++ b/cinder/volume/drivers/netapp/dataontap/block_base.py @@ -891,10 +891,10 @@ class NetAppBlockStorageLibrary(object): correspond to the list of remote wwn(s) that will export the volume. Example return values: - .. code-block:: json + .. code-block:: default { - 'driver_volume_type': 'fibre_channel' + 'driver_volume_type': 'fibre_channel', 'data': { 'target_discovered': True, 'target_lun': 1, @@ -906,10 +906,12 @@ class NetAppBlockStorageLibrary(object): } } - or + Or + + .. code-block:: default { - 'driver_volume_type': 'fibre_channel' + 'driver_volume_type': 'fibre_channel', 'data': { 'target_discovered': True, 'target_lun': 1, diff --git a/cinder/volume/drivers/vmware/vmdk.py b/cinder/volume/drivers/vmware/vmdk.py index d248a1877ac..1c8f18bed99 100644 --- a/cinder/volume/drivers/vmware/vmdk.py +++ b/cinder/volume/drivers/vmware/vmdk.py @@ -605,11 +605,11 @@ class VMwareVcVmdkDriver(driver.VolumeDriver): The implementation returns the following information: - .. code-block:: json + .. code-block:: default { - 'driver_volume_type': 'vmdk' - 'data': {'volume': $VOLUME_MOREF_VALUE + 'driver_volume_type': 'vmdk', + 'data': {'volume': $VOLUME_MOREF_VALUE, 'volume_id': $VOLUME_ID } } diff --git a/cinder/volume/volume_types.py b/cinder/volume/volume_types.py index cb77316ee68..5915357b420 100644 --- a/cinder/volume/volume_types.py +++ b/cinder/volume/volume_types.py @@ -275,7 +275,7 @@ def volume_types_diff(context, vol_type_id1, vol_type_id2): whether there is any difference, and 'diff' is a dictionary with the following format: - .. code-block:: json + .. code-block:: default { 'extra_specs': {'key1': (value_in_1st_vol_type, 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 297f5c5c71a..65119575adb 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py +++ b/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py @@ -69,7 +69,7 @@ class BrcdFCSanLookupService(fc_service.FCSanLookupService): :param target_wwn_list: List of target port WWN :returns: List -- device wwn map in following format - .. code-block:: json + .. code-block:: default { : {