Start using pyflakes
Instead of globally disabling pyflakes warnings, disable only those that occur frequently and fix the rest. Enable gating on those. Change-Id: I774d809ebcda2339b30c104b031211a3b2c491bd
This commit is contained in:
parent
9916c8f273
commit
4ddb58ce9e
2
tox.ini
2
tox.ini
|
@ -32,6 +32,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
|
|||
sphinx-build -b html {toxinidir}/docs/source {envtmpdir}/html
|
||||
|
||||
[flake8]
|
||||
ignore = E12,F,H
|
||||
ignore = E12,F821,F841,H
|
||||
show-source = True
|
||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||
|
|
|
@ -14,18 +14,18 @@
|
|||
# under the License.
|
||||
|
||||
|
||||
from troveclient.accounts import Accounts
|
||||
from troveclient.databases import Databases
|
||||
from troveclient.flavors import Flavors
|
||||
from troveclient.instances import Instances
|
||||
from troveclient.hosts import Hosts
|
||||
from troveclient.management import Management
|
||||
from troveclient.management import RootHistory
|
||||
from troveclient.root import Root
|
||||
from troveclient.storage import StorageInfo
|
||||
from troveclient.users import Users
|
||||
from troveclient.versions import Versions
|
||||
from troveclient.diagnostics import DiagnosticsInterrogator
|
||||
from troveclient.diagnostics import HwInfoInterrogator
|
||||
from troveclient.client import Dbaas
|
||||
from troveclient.client import TroveHTTPClient
|
||||
from troveclient.accounts import Accounts # noqa
|
||||
from troveclient.databases import Databases # noqa
|
||||
from troveclient.flavors import Flavors # noqa
|
||||
from troveclient.instances import Instances # noqa
|
||||
from troveclient.hosts import Hosts # noqa
|
||||
from troveclient.management import Management # noqa
|
||||
from troveclient.management import RootHistory # noqa
|
||||
from troveclient.root import Root # noqa
|
||||
from troveclient.storage import StorageInfo # noqa
|
||||
from troveclient.users import Users # noqa
|
||||
from troveclient.versions import Versions # noqa
|
||||
from troveclient.diagnostics import DiagnosticsInterrogator # noqa
|
||||
from troveclient.diagnostics import HwInfoInterrogator # noqa
|
||||
from troveclient.client import Dbaas # noqa
|
||||
from troveclient.client import TroveHTTPClient # noqa
|
||||
|
|
|
@ -128,23 +128,6 @@ class Auth1_1(Authenticator):
|
|||
"key": self.password}}
|
||||
return self._authenticate(auth_url, body, root_key='auth')
|
||||
|
||||
try:
|
||||
print(resp_body)
|
||||
self.auth_token = resp_body['auth']['token']['id']
|
||||
except KeyError:
|
||||
raise nova_exceptions.AuthorizationFailure()
|
||||
|
||||
catalog = resp_body['auth']['serviceCatalog']
|
||||
if 'cloudDatabases' not in catalog:
|
||||
raise nova_exceptions.EndpointNotFound()
|
||||
endpoints = catalog['cloudDatabases']
|
||||
for endpoint in endpoints:
|
||||
if self.region_name is None or \
|
||||
endpoint['region'] == self.region_name:
|
||||
self.management_url = endpoint['publicURL']
|
||||
return
|
||||
raise nova_exceptions.EndpointNotFound()
|
||||
|
||||
|
||||
class RaxAuthenticator(Authenticator):
|
||||
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
Trove Command line tool
|
||||
"""
|
||||
|
||||
#TODO(tim.simpson): optparse is deprecated. Replace with argparse.
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
|
|
@ -130,7 +130,6 @@ class TroveHTTPClient(httplib2.Http):
|
|||
_logger.debug("RESP:%s %s\n", resp, body)
|
||||
|
||||
def pretty_log(self, args, kwargs, resp, body):
|
||||
from troveclient import common
|
||||
if not _logger.isEnabledFor(logging.DEBUG):
|
||||
return
|
||||
|
||||
|
@ -283,7 +282,7 @@ class Dbaas(object):
|
|||
|
||||
Create an instance with your creds::
|
||||
|
||||
>>> red = Dbaas(USERNAME, API_KEY, TENANT, AUTH_URL, SERVICE_NAME,
|
||||
>>> red = Dbaas(USERNAME, API_KEY, TENANT, AUTH_URL, SERVICE_NAME, \
|
||||
SERVICE_URL)
|
||||
|
||||
Then call methods on its managers::
|
||||
|
|
|
@ -2,7 +2,6 @@ from troveclient import base
|
|||
from troveclient.common import check_for_exceptions
|
||||
from troveclient.common import limit_url
|
||||
from troveclient.common import Paginated
|
||||
import exceptions
|
||||
import urlparse
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
# under the License.
|
||||
|
||||
from troveclient import base
|
||||
import exceptions
|
||||
|
||||
|
||||
class Diagnostics(base.Resource):
|
||||
|
|
|
@ -16,10 +16,6 @@
|
|||
|
||||
from troveclient import base
|
||||
|
||||
import exceptions
|
||||
|
||||
from troveclient.common import check_for_exceptions
|
||||
|
||||
|
||||
class Flavor(base.Resource):
|
||||
"""
|
||||
|
|
|
@ -19,7 +19,6 @@ Trove Management Command line tool
|
|||
"""
|
||||
|
||||
import json
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ from troveclient import base
|
|||
|
||||
from troveclient import users
|
||||
from troveclient.common import check_for_exceptions
|
||||
import exceptions
|
||||
|
||||
|
||||
class Root(base.ManagerWithFind):
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import contextlib
|
||||
|
||||
from testtools import TestCase
|
||||
from troveclient import auth
|
||||
|
|
|
@ -6,7 +6,6 @@ from mock import Mock
|
|||
|
||||
from troveclient import base
|
||||
from troveclient import exceptions
|
||||
from troveclient import utils
|
||||
|
||||
"""
|
||||
Unit tests for base.py
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import contextlib
|
||||
import os
|
||||
import logging
|
||||
import httplib2
|
||||
import time
|
||||
|
@ -9,7 +7,6 @@ from mock import Mock
|
|||
|
||||
from troveclient import client
|
||||
from troveclient import exceptions
|
||||
from troveclient import utils
|
||||
|
||||
"""
|
||||
Unit tests for client.py
|
||||
|
|
|
@ -2,7 +2,6 @@ from testtools import TestCase
|
|||
from mock import Mock
|
||||
|
||||
from troveclient import security_groups
|
||||
from troveclient import base
|
||||
|
||||
"""
|
||||
Unit tests for security_groups.py
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import os
|
||||
from testtools import TestCase
|
||||
from troveclient import utils
|
||||
from troveclient import versions
|
||||
|
||||
|
||||
class UtilsTest(TestCase):
|
||||
|
@ -34,7 +33,7 @@ class UtilsTest(TestCase):
|
|||
self.assertEqual('', utils.env('test_abcd'))
|
||||
|
||||
def test_slugify(self):
|
||||
import unicodedata
|
||||
import unicodedata # noqa
|
||||
|
||||
self.assertEqual('not_unicode', utils.slugify('not_unicode'))
|
||||
self.assertEqual('unicode', utils.slugify(unicode('unicode')))
|
||||
|
|
|
@ -19,7 +19,6 @@ from troveclient.common import check_for_exceptions
|
|||
from troveclient.common import limit_url
|
||||
from troveclient.common import Paginated
|
||||
from troveclient.common import quote_user_host
|
||||
import exceptions
|
||||
import urlparse
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
class HookableMixin(object):
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from lxml import etree
|
||||
import json
|
||||
from numbers import Number
|
||||
|
||||
from troveclient import exceptions
|
||||
|
|
Loading…
Reference in New Issue