diff --git a/setup.cfg b/setup.cfg index fefbda55..20286342 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,7 @@ openstack.database.v1 = all_files = 1 source-dir = doc/source build-dir = doc/build -#warning-is-error = 1 +warning-is-error = 1 [upload_sphinx] upload-dir = doc/build/html diff --git a/troveclient/apiclient/auth.py b/troveclient/apiclient/auth.py index 48a096c5..cf9d3781 100644 --- a/troveclient/apiclient/auth.py +++ b/troveclient/apiclient/auth.py @@ -183,7 +183,7 @@ class BaseAuthPlugin(object): a request to authentication server. :param http_client: client object that needs authentication - :type http_client: HTTPClient + :type http_client: troveclient.client.HTTPClient :raises: AuthorizationFailure """ self.sufficient_options() @@ -213,8 +213,8 @@ class BaseAuthPlugin(object): :type service_type: string :param endpoint_type: Type of endpoint. Possible values: public or publicURL, - internal or internalURL, - admin or adminURL + internal or internalURL, + admin or adminURL :type endpoint_type: string :returns: tuple of token and endpoint strings :raises: EndpointException diff --git a/troveclient/apiclient/base.py b/troveclient/apiclient/base.py index 72ec0c7f..1b7e35fe 100644 --- a/troveclient/apiclient/base.py +++ b/troveclient/apiclient/base.py @@ -75,8 +75,8 @@ class HookableMixin(object): :param cls: class that registers hooks :param hook_type: hook type, e.g., '__pre_parse_args__' - :param **args: args to be passed to every hook function - :param **kwargs: kwargs to be passed to every hook function + :param args: args to be passed to every hook function + :param kwargs: kwargs to be passed to every hook function """ hook_funcs = cls._hooks_map.get(hook_type) or [] for hook_func in hook_funcs: diff --git a/troveclient/apiclient/client.py b/troveclient/apiclient/client.py index ee15e5b9..a95154c0 100644 --- a/troveclient/apiclient/client.py +++ b/troveclient/apiclient/client.py @@ -46,6 +46,7 @@ class HTTPClient(object): """This client handles sending HTTP requests to OpenStack servers. Features: + - share authentication information between several clients to different services (e.g., for compute and image clients); - reissue authentication request for expired tokens; @@ -58,6 +59,7 @@ class HTTPClient(object): `http_client.identity` or `http_client.compute`; - log requests and responses in a format that is easy to copy-and-paste into terminal and send the same request with curl. + """ user_agent = "troveclient.apiclient" @@ -151,7 +153,7 @@ class HTTPClient(object): :param method: method of HTTP request :param url: URL of HTTP request :param kwargs: any other parameter that can be passed to -' requests.Session.request (such as `headers`) or `json` + requests.Session.request (such as `headers`) or `json` that will be encoded as JSON and used as `data` argument """ kwargs.setdefault("headers", kwargs.get("headers", {})) @@ -206,7 +208,8 @@ class HTTPClient(object): :param method: method of HTTP request :param url: URL of HTTP request :param kwargs: any other parameter that can be passed to -' `HTTPClient.request` + `HTTPClient.request` + """ filter_args = { diff --git a/troveclient/utils.py b/troveclient/utils.py index 61216560..69e0b3d3 100644 --- a/troveclient/utils.py +++ b/troveclient/utils.py @@ -67,10 +67,12 @@ def add_arg(f, *args, **kwargs): def unauthenticated(f): """Adds 'unauthenticated' attribute to decorated function. - Usage: + Usage:: + @unauthenticated def mymethod(f): ... + """ f.unauthenticated = True return f @@ -89,10 +91,12 @@ def isunauthenticated(f): def service_type(stype): """Adds 'service_type' attribute to decorated function. - Usage: + Usage:: + @service_type('database') def mymethod(f): ... + """ def inner(f): f.service_type = stype diff --git a/troveclient/v1/backups.py b/troveclient/v1/backups.py index f7621be9..2104931b 100644 --- a/troveclient/v1/backups.py +++ b/troveclient/v1/backups.py @@ -80,7 +80,7 @@ class Backups(base.ManagerWithFind): :param description: (optional). :param parent_id: base for incremental backup (optional). :param incremental: flag to indicate incremental backup based on - last backup + last backup :returns: :class:`Backups` """ body = { diff --git a/troveclient/v1/instances.py b/troveclient/v1/instances.py index 2440fe3c..04eb05a6 100644 --- a/troveclient/v1/instances.py +++ b/troveclient/v1/instances.py @@ -254,7 +254,7 @@ class Instances(base.ManagerWithFind): """Restart the database instance. :param instance: The :class:`Instance` (or its ID) of the database - instance to restart. + instance to restart. """ body = {'restart': {}} self._action(instance, body) @@ -271,7 +271,7 @@ class Instances(base.ManagerWithFind): """Promote a replica to be the new replica_source of its set :param instance: The :class:`Instance` (or its ID) of the database - instance to promote. + instance to promote. """ body = {'promote_to_replica_source': {}} self._action(instance, body) @@ -280,7 +280,7 @@ class Instances(base.ManagerWithFind): """Eject a replica source from its set :param instance: The :class:`Instance` (or its ID) of the database - instance to eject. + instance to eject. """ body = {'eject_replica_source': {}} self._action(instance, body) @@ -368,7 +368,7 @@ class Instances(base.ManagerWithFind): """Get a list of all guest logs. :param instance: The :class:`Instance` (or its ID) of the database - instance to get the log for. + instance to get the log for. :rtype: list of :class:`DatastoreLog`. """ url = '/instances/%s/log' % base.getid(instance) @@ -398,7 +398,7 @@ class Instances(base.ManagerWithFind): """Perform action on guest log. :param instance: The :class:`Instance` (or its ID) of the database - instance to get the log for. + instance to get the log for. :param log_name: The name of to publish :param enable: Turn on :param disable: Turn off @@ -437,7 +437,7 @@ class Instances(base.ManagerWithFind): """Return generator to yield the last lines of guest log. :param instance: The :class:`Instance` (or its ID) of the database - instance to get the log for. + instance to get the log for. :param log_name: The name of to publish :param publish: Publish updates before displaying log :param lines: Display last lines of log (0 for all lines) @@ -492,7 +492,7 @@ class Instances(base.ManagerWithFind): """Saves a guest log to a file. :param instance: The :class:`Instance` (or its ID) of the database - instance to get the log for. + instance to get the log for. :param log_name: The name of to publish :param publish: Publish updates before displaying log :rtype: Filename to which log was saved