From fddef7bbec2ec19b411e063db09f2d0a6c90168f Mon Sep 17 00:00:00 2001 From: XieYingYun Date: Sat, 25 Mar 2017 17:17:50 +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: I8939994be1144de3ebdc6bfa3b414f9615f621dd --- mogan/api/controllers/v1/instances.py | 4 ++-- mogan/api/validation/__init__.py | 2 +- mogan/common/fsm.py | 4 ++-- mogan/common/ironic.py | 2 +- mogan/common/utils.py | 2 +- mogan/engine/base_manager.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mogan/api/controllers/v1/instances.py b/mogan/api/controllers/v1/instances.py index 5148ddcb..f6399c67 100644 --- a/mogan/api/controllers/v1/instances.py +++ b/mogan/api/controllers/v1/instances.py @@ -102,9 +102,9 @@ class InstanceStatesController(InstanceControllerBase): :param instance_uuid: the UUID of a instance. :param target: the desired target to change power state, on, off or reboot. - :raises: Conflict (HTTP 409) if a power operation is + :raises Conflict (HTTP 409): if a power operation is already in progress. - :raises: BadRequest (HTTP 400) if the requested target + :raises BadRequest (HTTP 400): if the requested target state is not valid or if the instance is in CLEANING state. """ diff --git a/mogan/api/validation/__init__.py b/mogan/api/validation/__init__.py index 57e66d7d..f76a7619 100644 --- a/mogan/api/validation/__init__.py +++ b/mogan/api/validation/__init__.py @@ -29,7 +29,7 @@ def check_schema(body, schema): include the required information. :param body: create body - :raises: InvalidParameterValue if validation of create body fails. + :raises InvalidParameterValue: if validation of create body fails. """ validator = jsonschema.Draft4Validator( schema, format_checker=jsonschema.FormatChecker()) diff --git a/mogan/common/fsm.py b/mogan/common/fsm.py index 52052522..fcce1e6b 100644 --- a/mogan/common/fsm.py +++ b/mogan/common/fsm.py @@ -61,7 +61,7 @@ class FSM(machines.FiniteMachine): """Is the state stable? :param state: the state of interest - :raises: InvalidState if the state is invalid + :raises InvalidState: if the state is invalid :returns: True if it is a stable state; False otherwise """ try: @@ -106,7 +106,7 @@ class FSM(machines.FiniteMachine): A target state must be a valid state that is 'stable'. :param target: The target state - :raises: exception.InvalidState if it is an invalid target state + :raises exception.InvalidState: if it is an invalid target state """ if target is None: return diff --git a/mogan/common/ironic.py b/mogan/common/ironic.py index cb27043d..89851293 100644 --- a/mogan/common/ironic.py +++ b/mogan/common/ironic.py @@ -93,7 +93,7 @@ class IronicClientWrapper(object): :param attr: Path of final attribute to get. E.g., "a.b.c.d" :returns: The value of the final named attribute. - :raises: AttributeError will be raised if the path is invalid. + :raises AttributeError: will be raised if the path is invalid. """ for attribute in attr.split("."): obj = getattr(obj, attribute) diff --git a/mogan/common/utils.py b/mogan/common/utils.py index c3cb95a4..80595080 100644 --- a/mogan/common/utils.py +++ b/mogan/common/utils.py @@ -69,7 +69,7 @@ def validate_and_normalize_mac(address): :param address: MAC address to be validated and normalized. :returns: Normalized and validated MAC address. - :raises: InvalidMAC If the MAC address is not valid. + :raises InvalidMAC: If the MAC address is not valid. """ if not is_valid_mac(address): diff --git a/mogan/engine/base_manager.py b/mogan/engine/base_manager.py index 469d79e8..20eb3129 100644 --- a/mogan/engine/base_manager.py +++ b/mogan/engine/base_manager.py @@ -48,7 +48,7 @@ class BaseEngineManager(periodic_task.PeriodicTasks): """Initialize the engine host. :param admin_context: the admin context to pass to periodic tasks. - :raises: RuntimeError when engine is already running. + :raises RuntimeError: when engine is already running. """ if self._started: raise RuntimeError(_('Attempt to start an already running '