[DOC] Fix "Title level inconsistent" warning

This commit fixes the warning "Title level inconsistent". And the module
API docs should be shown up.

Change-Id: Ie9a3656b0a58300d611352d054868440f0ffd387
This commit is contained in:
Masayuki Igawa 2017-09-07 10:22:37 +09:00
parent 3f310141fb
commit a1c3af3350
No known key found for this signature in database
GPG Key ID: 290F53EDC899BF89
3 changed files with 71 additions and 72 deletions

View File

@ -130,19 +130,18 @@ this by leveraging the ``force_new`` kwarg::
# role
provider.clear_creds()
API Reference
=============
------------------------------
API Reference
-------------
The dynamic credentials module
------------------------------
''''''''''''''''''''''''''''''
.. automodule:: tempest.lib.common.dynamic_creds
:members:
--------------------------------------
The pre-provisioned credentials module
--------------------------------------
''''''''''''''''''''''''''''''''''''''
.. automodule:: tempest.lib.common.preprov_creds
:members:

View File

@ -28,6 +28,43 @@ LOG = logging.getLogger(__name__)
class DynamicCredentialProvider(cred_provider.CredentialProvider):
"""Creates credentials dynamically for tests
A credential provider that, based on an initial set of
admin credentials, creates new credentials on the fly for
tests to use and then discard.
:param str identity_version: identity API version to use `v2` or `v3`
:param str admin_role: name of the admin role added to admin users
:param str name: names of dynamic resources include this parameter
when specified
:param str credentials_domain: name of the domain where the users
are created. If not defined, the project
domain from admin_credentials is used
:param dict network_resources: network resources to be created for
the created credentials
:param Credentials admin_creds: initial admin credentials
:param bool identity_admin_domain_scope: Set to true if admin should be
scoped to the domain. By
default this is False and the
admin role is scoped to the
project.
:param str identity_admin_role: The role name to use for admin
:param list extra_roles: A list of strings for extra roles that should
be assigned to all created users
:param bool neutron_available: Whether we are running in an environemnt
with neutron
:param bool create_networks: Whether dynamic project networks should be
created or not
:param project_network_cidr: The CIDR to use for created project
networks
:param project_network_mask_bits: The network mask bits to use for
created project networks
:param public_network_id: The id for the public network to use
:param identity_admin_endpoint_type: The endpoint type for identity
admin clients. Defaults to public.
:param identity_uri: Identity URI of the target cloud
"""
def __init__(self, identity_version, name=None, network_resources=None,
credentials_domain=None, admin_role=None, admin_creds=None,
@ -37,43 +74,6 @@ class DynamicCredentialProvider(cred_provider.CredentialProvider):
project_network_cidr=None, project_network_mask_bits=None,
public_network_id=None, resource_prefix=None,
identity_admin_endpoint_type='public', identity_uri=None):
"""Creates credentials dynamically for tests
A credential provider that, based on an initial set of
admin credentials, creates new credentials on the fly for
tests to use and then discard.
:param str identity_version: identity API version to use `v2` or `v3`
:param str admin_role: name of the admin role added to admin users
:param str name: names of dynamic resources include this parameter
when specified
:param str credentials_domain: name of the domain where the users
are created. If not defined, the project
domain from admin_credentials is used
:param dict network_resources: network resources to be created for
the created credentials
:param Credentials admin_creds: initial admin credentials
:param bool identity_admin_domain_scope: Set to true if admin should be
scoped to the domain. By
default this is False and the
admin role is scoped to the
project.
:param str identity_admin_role: The role name to use for admin
:param list extra_roles: A list of strings for extra roles that should
be assigned to all created users
:param bool neutron_available: Whether we are running in an environemnt
with neutron
:param bool create_networks: Whether dynamic project networks should be
created or not
:param project_network_cidr: The CIDR to use for created project
networks
:param project_network_mask_bits: The network mask bits to use for
created project networks
:param public_network_id: The id for the public network to use
:param identity_admin_endpoint_type: The endpoint type for identity
admin clients. Defaults to public.
:param identity_uri: Identity URI of the target cloud
"""
super(DynamicCredentialProvider, self).__init__(
identity_version=identity_version, identity_uri=identity_uri,
admin_role=admin_role, name=name,

View File

@ -41,6 +41,35 @@ def read_accounts_yaml(path):
class PreProvisionedCredentialProvider(cred_provider.CredentialProvider):
"""Credentials provider using pre-provisioned accounts
This credentials provider loads the details of pre-provisioned
accounts from a YAML file, in the format specified by
``etc/accounts.yaml.sample``. It locks accounts while in use, using the
external locking mechanism, allowing for multiple python processes
to share a single account file, and thus running tests in parallel.
The accounts_lock_dir must be generated using `lockutils.get_lock_path`
from the oslo.concurrency library. For instance::
accounts_lock_dir = os.path.join(lockutils.get_lock_path(CONF),
'test_accounts')
Role names for object storage are optional as long as the
`operator` and `reseller_admin` credential types are not used in the
accounts file.
:param identity_version: identity version of the credentials
:param admin_role: name of the admin role
:param test_accounts_file: path to the accounts YAML file
:param accounts_lock_dir: the directory for external locking
:param name: name of the hash file (optional)
:param credentials_domain: name of the domain credentials belong to
(if no domain is configured)
:param object_storage_operator_role: name of the role
:param object_storage_reseller_admin_role: name of the role
:param identity_uri: Identity URI of the target cloud
"""
# Exclude from the hash fields specific to v2 or v3 identity API
# i.e. only include user*, project*, tenant* and password
@ -51,35 +80,6 @@ class PreProvisionedCredentialProvider(cred_provider.CredentialProvider):
accounts_lock_dir, name=None, credentials_domain=None,
admin_role=None, object_storage_operator_role=None,
object_storage_reseller_admin_role=None, identity_uri=None):
"""Credentials provider using pre-provisioned accounts
This credentials provider loads the details of pre-provisioned
accounts from a YAML file, in the format specified by
`etc/accounts.yaml.sample`. It locks accounts while in use, using the
external locking mechanism, allowing for multiple python processes
to share a single account file, and thus running tests in parallel.
The accounts_lock_dir must be generated using `lockutils.get_lock_path`
from the oslo.concurrency library. For instance:
accounts_lock_dir = os.path.join(lockutils.get_lock_path(CONF),
'test_accounts')
Role names for object storage are optional as long as the
`operator` and `reseller_admin` credential types are not used in the
accounts file.
:param identity_version: identity version of the credentials
:param admin_role: name of the admin role
:param test_accounts_file: path to the accounts YAML file
:param accounts_lock_dir: the directory for external locking
:param name: name of the hash file (optional)
:param credentials_domain: name of the domain credentials belong to
(if no domain is configured)
:param object_storage_operator_role: name of the role
:param object_storage_reseller_admin_role: name of the role
:param identity_uri: Identity URI of the target cloud
"""
super(PreProvisionedCredentialProvider, self).__init__(
identity_version=identity_version, name=name,
admin_role=admin_role, credentials_domain=credentials_domain,