From 7b049185578b97a19e97a6223f65e76ca3a41fe1 Mon Sep 17 00:00:00 2001 From: weizhao Date: Wed, 29 Mar 2017 14:53:15 +0800 Subject: [PATCH] Fix some reST field lists in docstrings Probably the most common format for documenting arguments is reST field lists [1]. This change updates some docstrings to comply with the field lists syntax. [1] http://sphinx-doc.org/domains.html#info-field-lists Change-Id: I74c8e09f825d34a7cb58cbd800ea61c8c93809e0 --- ironic/common/glance_service/service_utils.py | 2 +- ironic/common/images.py | 2 +- ironic/drivers/base.py | 4 ++-- ironic/drivers/modules/ilo/common.py | 4 ++-- ironic/drivers/modules/ilo/inspect.py | 2 +- ironic/drivers/modules/oneview/common.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ironic/common/glance_service/service_utils.py b/ironic/common/glance_service/service_utils.py index 113b94e482..714fed58b0 100644 --- a/ironic/common/glance_service/service_utils.py +++ b/ironic/common/glance_service/service_utils.py @@ -163,7 +163,7 @@ def parse_image_ref(image_href): :param image_href: href of an image :returns: a tuple of the form (image_id, host, port, use_ssl) - :raises ValueError + :raises ValueError: when input image href is invalid """ if '/' not in six.text_type(image_href): image_id = image_href diff --git a/ironic/common/images.py b/ironic/common/images.py index 2321c8d3a7..dd89f17ef1 100644 --- a/ironic/common/images.py +++ b/ironic/common/images.py @@ -461,7 +461,7 @@ def is_whole_disk_image(ctx, instance_info): :param ctx: an admin context :param instance_info: a node's instance info dict - :returns True for whole disk images and False for partition images + :returns: True for whole disk images and False for partition images and None on no image_source or Error. """ image_source = instance_info.get('image_source') diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py index 90025ab486..a7763d3b3c 100644 --- a/ironic/drivers/base.py +++ b/ironic/drivers/base.py @@ -1192,7 +1192,7 @@ def _validate_argsinfo(argsinfo): ‘required’: Boolean. Optional; default is False. True if this argument is required. If so, it must be specified in the clean request; false if it is optional. - :raises InvalidParameterValue if any of the arguments are invalid + :raises InvalidParameterValue: if any of the arguments are invalid """ if not argsinfo: return @@ -1286,7 +1286,7 @@ def clean_step(priority, abortable=False, argsinfo=None): ‘required’: Boolean. Optional; default is False. True if this argument is required. If so, it must be specified in the clean request; false if it is optional. - :raises InvalidParameterValue if any of the arguments are invalid + :raises InvalidParameterValue: if any of the arguments are invalid """ def decorator(func): func._is_clean_step = True diff --git a/ironic/drivers/modules/ilo/common.py b/ironic/drivers/modules/ilo/common.py index 9b2c9183d1..651b29e53d 100644 --- a/ironic/drivers/modules/ilo/common.py +++ b/ironic/drivers/modules/ilo/common.py @@ -266,9 +266,9 @@ def _parse_snmp_driver_info(info): :param info: driver_info dictionary. :returns: a dictionary containing SNMP information. - :raises exception.MissingParameterValue if any of the mandatory + :raises exception.MissingParameterValue: if any of the mandatory parameter values are not provided. - :raises exception.InvalidParameterValue if the value provided + :raises exception.InvalidParameterValue: if the value provided for SNMP_OPTIONAL_PROPERTIES has an invalid value. """ snmp_info = {} diff --git a/ironic/drivers/modules/ilo/inspect.py b/ironic/drivers/modules/ilo/inspect.py index 80fcb940ca..8c0d8a5e64 100644 --- a/ironic/drivers/modules/ilo/inspect.py +++ b/ironic/drivers/modules/ilo/inspect.py @@ -145,7 +145,7 @@ def _get_capabilities(node, ilo_object): :param node: Node object. :param ilo_object: an instance of ilo drivers. - :returns : a string of capabilities like + :returns: a string of capabilities like 'key1:value1,key2:value2,key3:value3' or None. diff --git a/ironic/drivers/modules/oneview/common.py b/ironic/drivers/modules/oneview/common.py index 912a29709a..7be8035f02 100644 --- a/ironic/drivers/modules/oneview/common.py +++ b/ironic/drivers/modules/oneview/common.py @@ -118,7 +118,7 @@ def get_oneview_info(node): :enclosure_group_uri: the uri of the enclosure group in OneView :server_profile_template_uri: the uri of the server profile template in OneView - :raises OneViewInvalidNodeParameter if node capabilities are malformed + :raises OneViewInvalidNodeParameter: if node capabilities are malformed """ try: