From 6b6de55c1c98b5ddec5f94154a5ed17e5b3bb51b Mon Sep 17 00:00:00 2001 From: junboli Date: Tue, 18 Jul 2017 16:24:46 +0800 Subject: [PATCH] TrivialFix for the docstring and json format 1. correct the docstring which may cause Sphinx warning in cinder/db/sqlalchemy/api.py cinder/volume/qos_specs.py 2. pretty format the param json data. 3. add code block for the param json data. Change-Id: I5176f237756ce92a80ed7ab74c7a56ef3be060fb --- cinder/db/sqlalchemy/api.py | 22 +++++++++++++++------- cinder/volume/qos_specs.py | 14 +++++++++++--- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index 64256a47604..25285019cdc 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -4310,13 +4310,21 @@ def qos_specs_create(context, values): """Create a new QoS specs. :param values dictionary that contains specifications for QoS - e.g. {'name': 'Name', - 'consumer': 'front-end', - 'specs': { - 'total_iops_sec': 1000, - 'total_bytes_sec': 1024000 - } - } + + Expected format of the input parameter: + + .. code-block:: json + + { + 'name': 'Name', + 'consumer': 'front-end', + 'specs': + { + 'total_iops_sec': 1000, + 'total_bytes_sec': 1024000 + } + } + """ specs_id = str(uuid.uuid4()) session = get_session() diff --git a/cinder/volume/qos_specs.py b/cinder/volume/qos_specs.py index 33be69c29fc..b7baef3b693 100644 --- a/cinder/volume/qos_specs.py +++ b/cinder/volume/qos_specs.py @@ -35,10 +35,18 @@ CONTROL_LOCATION = ['front-end', 'back-end', 'both'] def create(context, name, specs=None): """Creates qos_specs. - :param specs dictionary that contains specifications for QoS - e.g. {'consumer': 'front-end', + :param specs: Dictionary that contains specifications for QoS + + Expected format of the input parameter: + + .. code-block:: json + + { + 'consumer': 'front-end', 'total_iops_sec': 1000, - 'total_bytes_sec': 1024000} + 'total_bytes_sec': 1024000 + } + """ consumer = specs.get('consumer') if consumer: