summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-01-13 09:33:54 +0000
committerGerrit Code Review <review@openstack.org>2014-01-13 09:33:54 +0000
commit1a704bef5550e2045da6d5cc2481fda7b708f77a (patch)
tree9a6a05b66d6eca23644edcee26afcc77e209b4c3
parentda441ca247fc90d7a266b2fa9e33c6d62b9e656f (diff)
parentd4a62491e177b06ee9796fea5708792fb2152e9f (diff)
downloadpython-troveclient-1a704bef5550e2045da6d5cc2481fda7b708f77a.tar.gz
Merge "Tighten flake8 checks in Gating"
-rw-r--r--tox.ini3
-rw-r--r--troveclient/common.py5
-rw-r--r--troveclient/compat/cli.py3
-rw-r--r--troveclient/compat/common.py11
-rw-r--r--troveclient/compat/exceptions.py6
-rw-r--r--troveclient/exceptions.py6
-rw-r--r--troveclient/v1/root.py3
7 files changed, 22 insertions, 15 deletions
diff --git a/tox.ini b/tox.ini
index 7edefb6..5efc421 100644
--- a/tox.ini
+++ b/tox.ini
@@ -36,7 +36,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
sphinx-build -b html {toxinidir}/docs/source {envtmpdir}/html
[flake8]
-
-ignore = F401,F403,F821,H202,H306,H401,H402,H403,H404
+ignore = F821,H202,H306,H402,H404
show-source = True
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,
diff --git a/troveclient/common.py b/troveclient/common.py
index a40d921..a3ffd8e 100644
--- a/troveclient/common.py
+++ b/troveclient/common.py
@@ -48,8 +48,9 @@ def quote_user_host(user, host):
class Paginated(object):
- """ Pretends to be a list if you iterate over it, but also keeps a
- next property you can use to get the next page of data. """
+ """Pretends to be a list if you iterate over it, but also keeps a
+ next property you can use to get the next page of data.
+ """
def __init__(self, items=[], next_marker=None, links=[]):
self.items = items
diff --git a/troveclient/compat/cli.py b/troveclient/compat/cli.py
index fcb1c6a..892f8b8 100644
--- a/troveclient/compat/cli.py
+++ b/troveclient/compat/cli.py
@@ -202,7 +202,8 @@ class UserCommands(common.AuthedCommandsBase):
def grant(self):
"""Allow an existing user permissions to access one or more
- databases."""
+ databases.
+ """
self._require('id', 'name', 'databases')
self._make_list('databases')
self.dbaas.users.grant(self.id, self.name, self.databases,
diff --git a/troveclient/compat/common.py b/troveclient/compat/common.py
index a50914e..0cfbd9e 100644
--- a/troveclient/compat/common.py
+++ b/troveclient/compat/common.py
@@ -29,7 +29,8 @@ from troveclient.openstack.common.py3kcompat import urlutils
def methods_of(obj):
"""Get all callable methods of an object that don't start with underscore
- returns a list of tuples of the form (method_name, method)"""
+ returns a list of tuples of the form (method_name, method).
+ """
result = {}
for i in dir(obj):
if callable(getattr(obj, i)) and not i.startswith('_'):
@@ -82,7 +83,8 @@ def quote_user_host(user, host):
class CliOptions(object):
"""A token object containing the user, apikey and token which
- is pickleable."""
+ is pickleable.
+ """
APITOKEN = os.path.expanduser("~/.apitoken")
@@ -400,8 +402,9 @@ class AuthedCommandsBase(CommandsBase):
class Paginated(object):
- """ Pretends to be a list if you iterate over it, but also keeps a
- next property you can use to get the next page of data. """
+ """Pretends to be a list if you iterate over it, but also keeps a
+ next property you can use to get the next page of data.
+ """
def __init__(self, items=[], next_marker=None, links=[]):
self.items = items
diff --git a/troveclient/compat/exceptions.py b/troveclient/compat/exceptions.py
index 2ec3fb4..9761128 100644
--- a/troveclient/compat/exceptions.py
+++ b/troveclient/compat/exceptions.py
@@ -15,7 +15,8 @@
class UnsupportedVersion(Exception):
"""Indicates that the user is trying to use an unsupported
- version of the API"""
+ version of the API.
+ """
pass
@@ -33,7 +34,8 @@ class NoUniqueMatch(Exception):
class NoTokenLookupException(Exception):
"""This form of authentication does not support looking up
- endpoints from an existing token."""
+ endpoints from an existing token.
+ """
pass
diff --git a/troveclient/exceptions.py b/troveclient/exceptions.py
index 23db77e..5cfd235 100644
--- a/troveclient/exceptions.py
+++ b/troveclient/exceptions.py
@@ -20,7 +20,8 @@
class UnsupportedVersion(Exception):
"""Indicates that the user is trying to use an unsupported
- version of the API"""
+ version of the API.
+ """
pass
@@ -38,7 +39,8 @@ class NoUniqueMatch(Exception):
class NoTokenLookupException(Exception):
"""This form of authentication does not support looking up
- endpoints from an existing token."""
+ endpoints from an existing token.
+ """
pass
diff --git a/troveclient/v1/root.py b/troveclient/v1/root.py
index 4ceaa92..5893793 100644
--- a/troveclient/v1/root.py
+++ b/troveclient/v1/root.py
@@ -38,8 +38,7 @@ class Root(base.ManagerWithFind):
return body['user']['name'], body['user']['password']
def is_root_enabled(self, instance_id):
- """ Return True if root is enabled for the instance;
- False otherwise"""
+ """Return whether root is enabled for the instance."""
resp, body = self.api.client.get(self.url % instance_id)
common.check_for_exceptions(resp, body)
return self.resource_class(self, body, loaded=True)