From e27d781455c649fe9349bf408b74292e81e2b4ec Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 2 Apr 2019 17:04:53 -0500 Subject: [PATCH] Fix code-block JSON format issues Sphinx 2.0 is more strict on enforcing proper format for the specified code type. This resulted in a few warnings due to JSON code blocks not being valid JSON. This cleans up a few cases that were not properly formatted. Closes-bug: #1822891 Change-Id: Id6fa50b759add5d2286b98f1752a7ff92bf0515d Signed-off-by: Sean McGinnis --- cinder/api/v3/attachments.py | 8 ++--- cinder/volume/manager.py | 70 ++++++++++++++++++------------------ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/cinder/api/v3/attachments.py b/cinder/api/v3/attachments.py index d17a5ce4b40..9651a32b185 100644 --- a/cinder/api/v3/attachments.py +++ b/cinder/api/v3/attachments.py @@ -144,7 +144,7 @@ class AttachmentsController(wsgi.Controller): "connector": { "initiator": "iqn.1993-08.org.debian:01:cad181614cec", - "ip":"192.168.1.20", + "ip": "192.168.1.20", "platform": "x86_64", "host": "tempest-1", "os_type": "linux2", @@ -215,13 +215,13 @@ class AttachmentsController(wsgi.Controller): "connector": { "initiator": "iqn.1993-08.org.debian:01:cad181614cec", - "ip":"192.168.1.20", + "ip": "192.168.1.20", "platform": "x86_64", "host": "tempest-1", "os_type": "linux2", - "multipath": False, + "multipath": false, "mountpoint": "/dev/vdb", - "mode": None|"rw"|"ro", + "mode": "None|rw|ro" } } } diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 69e96d0e5de..182b4392b03 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -1743,40 +1743,42 @@ class VolumeManager(manager.CleanableManager, This method calls the driver initialize_connection and returns it to the caller. The connector parameter is a dictionary with information about the host that will connect to the volume in the - following format:: + following format: - .. code:: json + .. code:: json - { - 'ip': ip, - 'initiator': initiator, - } + { + "ip": "", + "initiator": "" + } - ip: the ip address of the connecting machine + ip: + the ip address of the connecting machine - initiator: the iscsi initiator name of the connecting machine. - This can be None if the connecting machine does not support iscsi - connections. + initiator: + the iscsi initiator name of the connecting machine. This can be + None if the connecting machine does not support iscsi connections. driver is responsible for doing any necessary security setup and - returning a connection_info dictionary in the following format:: + returning a connection_info dictionary in the following format: - .. code:: json + .. code:: json - { - 'driver_volume_type': driver_volume_type, - 'data': data, - } + { + "driver_volume_type": "", + "data": "" + } - driver_volume_type: a string to identify the type of volume. This - can be used by the calling code to determine the - strategy for connecting to the volume. This could - be 'iscsi', 'rbd', 'sheepdog', etc. + driver_volume_type: + a string to identify the type of volume. This can be used by the + calling code to determine the strategy for connecting to the + volume. This could be 'iscsi', 'rbd', 'sheepdog', etc. + + data: + this is the data that the calling code will use to connect to the + volume. Keep in mind that this will be serialized to json in + various places, so it should not contain any non-json data types. - data: this is the data that the calling code will use to connect - to the volume. Keep in mind that this will be serialized to - json in various places, so it should not contain any non-json - data types. """ # NOTE(flaper87): Verify the driver is enabled # before going forward. The exception will be caught @@ -4921,31 +4923,29 @@ class VolumeManager(manager.CleanableManager, .. code:: json { - 'replication_targets': [ + "replication_targets": [ { - 'backend_id': 'vendor-id-1', - 'unique_key': 'val1', - ...... + "backend_id": "vendor-id-1", + "unique_key": "val1" }, { - 'backend_id': 'vendor-id-2', - 'unique_key': 'val2', - ...... + "backend_id": "vendor-id-2", + "unique_key": "val2" } ] } Response example for non-admin: - .. code json + .. code:: json { - 'replication_targets': [ + "replication_targets": [ { - 'backend_id': 'vendor-id-1' + "backend_id": "vendor-id-1" }, { - 'backend_id': 'vendor-id-2' + "backend_id": "vendor-id-2" } ] }