From 535e2bf4b80b28065eac5b10991341dda4090326 Mon Sep 17 00:00:00 2001 From: lingyongxu Date: Tue, 5 Sep 2017 14:58:20 +0800 Subject: 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: I1e4221e886a75177c4607817a78dbcda37dfa57a --- functionaltests/cli/v1/behaviors/acl_behaviors.py | 26 +++++++++++----------- .../cli/v1/behaviors/container_behaviors.py | 2 +- .../cli/v1/behaviors/secret_behaviors.py | 4 ++-- functionaltests/utils.py | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/functionaltests/cli/v1/behaviors/acl_behaviors.py b/functionaltests/cli/v1/behaviors/acl_behaviors.py index d3d7276..443ace7 100644 --- a/functionaltests/cli/v1/behaviors/acl_behaviors.py +++ b/functionaltests/cli/v1/behaviors/acl_behaviors.py @@ -57,8 +57,8 @@ class ACLBehaviors(base_behaviors.BaseBehaviors): def acl_delete(self, entity_ref): """Delete a secret or container acl - :param entity_ref Reference to secret or container entity - :return If error returns stderr string otherwise returns None. + :param entity_ref: Reference to secret or container entity + :return: If error returns stderr string otherwise returns None. """ argv = ['acl', 'delete'] self.add_auth_and_endpoint(argv) @@ -74,8 +74,8 @@ class ACLBehaviors(base_behaviors.BaseBehaviors): def acl_get(self, entity_ref): """Get a 'read' ACL setting for a secret or a container. - :param entity_ref Reference to secret or container entity - :return dict of 'read' operation ACL settings if found otherwise empty + :param entity_ref: Reference to secret or container entity + :return: dict of 'read' operation ACL settings if found otherwise empty dict in case of error. """ argv = ['acl', 'get'] @@ -95,14 +95,14 @@ class ACLBehaviors(base_behaviors.BaseBehaviors): operation_type='read'): """Submits a secret or container ACL - :param entity_ref Reference to secret or container entity - :param users List of users for ACL + :param entity_ref: Reference to secret or container entity + :param users: List of users for ACL :param project_access: Flag to pass for project access behavior :param use_short_arg: Flag to indicate if use short arguments in cli. Default is False :param operation_type: ACL operation type. Default is 'read' as Barbican currently supports only that type of operation. - :return dict of 'read' operation ACL settings if found otherwise empty + :return: dict of 'read' operation ACL settings if found otherwise empty dict in case of error. """ argv = ['acl', 'submit'] @@ -128,14 +128,14 @@ class ACLBehaviors(base_behaviors.BaseBehaviors): operation_type='read'): """Add to a secret or container ACL - :param entity_ref Reference to secret or container entity - :param users List of users to be added in ACL + :param entity_ref: Reference to secret or container entity + :param users: List of users to be added in ACL :param project_access: Flag to pass for project access behavior :param use_short_arg: Flag to indicate if use short arguments in cli. Default is False :param operation_type: ACL operation type. Default is 'read' as Barbican currently supports only that type of operation. - :return dict of 'read' operation ACL settings if found otherwise empty + :return: dict of 'read' operation ACL settings if found otherwise empty dict in case of error. """ argv = ['acl', 'user', 'add'] @@ -162,14 +162,14 @@ class ACLBehaviors(base_behaviors.BaseBehaviors): operation_type='read'): """Remove users from a secret or container ACL - :param entity_ref Reference to secret or container entity - :param users List of users to be removed from ACL + :param entity_ref: Reference to secret or container entity + :param users: List of users to be removed from ACL :param project_access: Flag to pass for project access behavior :param use_short_arg: Flag to indicate if use short arguments in cli. Default is False :param operation_type: ACL operation type. Default is 'read' as Barbican currently supports only that type of operation. - :return dict of 'read' operation ACL settings if found otherwise empty + :return: dict of 'read' operation ACL settings if found otherwise empty dict in case of error. """ argv = ['acl', 'user', 'remove'] diff --git a/functionaltests/cli/v1/behaviors/container_behaviors.py b/functionaltests/cli/v1/behaviors/container_behaviors.py index d487eda..1db4a1f 100644 --- a/functionaltests/cli/v1/behaviors/container_behaviors.py +++ b/functionaltests/cli/v1/behaviors/container_behaviors.py @@ -62,7 +62,7 @@ class ContainerBehaviors(base_behaviors.BaseBehaviors): """Get a container :param: the href to a container - :return dict of container values, or an empty dict if the container + :return: dict of container values, or an empty dict if the container is not found. """ argv = ['secret', 'container', 'get'] diff --git a/functionaltests/cli/v1/behaviors/secret_behaviors.py b/functionaltests/cli/v1/behaviors/secret_behaviors.py index 1e970f1..5ea5e9a 100644 --- a/functionaltests/cli/v1/behaviors/secret_behaviors.py +++ b/functionaltests/cli/v1/behaviors/secret_behaviors.py @@ -83,7 +83,7 @@ class SecretBehaviors(base_behaviors.BaseBehaviors): """Get a secret :param: the href to a secret - :return dict of secret values, or an empty dict if the secret + :return: dict of secret values, or an empty dict if the secret is not found. """ argv = ['secret', 'get'] @@ -104,7 +104,7 @@ class SecretBehaviors(base_behaviors.BaseBehaviors): :param: the href to a secret :param raw if True then add "-f value" to get raw payload (ie not within a PrettyTable). If False then omit -f. - :return string representing the secret payload. + :return: string representing the secret payload. """ argv = ['secret', 'get'] self.add_auth_and_endpoint(argv) diff --git a/functionaltests/utils.py b/functionaltests/utils.py index 3e1c094..367dee0 100644 --- a/functionaltests/utils.py +++ b/functionaltests/utils.py @@ -126,7 +126,7 @@ def create_timestamp_w_tz_and_offset(timezone=None, days=0, hours=0, minutes=0, :param hours: The offset in hours :param minutes: The offset in minutes - :return a timestamp + :return: a timestamp """ if timezone is None: timezone = time.strftime("%z") -- cgit v1.2.1