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:
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
|
sphinx-build -b html {toxinidir}/docs/source {envtmpdir}/html
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
ignore = E12,F,H
|
ignore = E12,F821,F841,H
|
||||||
show-source = True
|
show-source = True
|
||||||
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||||
|
@@ -14,18 +14,18 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
from troveclient.accounts import Accounts
|
from troveclient.accounts import Accounts # noqa
|
||||||
from troveclient.databases import Databases
|
from troveclient.databases import Databases # noqa
|
||||||
from troveclient.flavors import Flavors
|
from troveclient.flavors import Flavors # noqa
|
||||||
from troveclient.instances import Instances
|
from troveclient.instances import Instances # noqa
|
||||||
from troveclient.hosts import Hosts
|
from troveclient.hosts import Hosts # noqa
|
||||||
from troveclient.management import Management
|
from troveclient.management import Management # noqa
|
||||||
from troveclient.management import RootHistory
|
from troveclient.management import RootHistory # noqa
|
||||||
from troveclient.root import Root
|
from troveclient.root import Root # noqa
|
||||||
from troveclient.storage import StorageInfo
|
from troveclient.storage import StorageInfo # noqa
|
||||||
from troveclient.users import Users
|
from troveclient.users import Users # noqa
|
||||||
from troveclient.versions import Versions
|
from troveclient.versions import Versions # noqa
|
||||||
from troveclient.diagnostics import DiagnosticsInterrogator
|
from troveclient.diagnostics import DiagnosticsInterrogator # noqa
|
||||||
from troveclient.diagnostics import HwInfoInterrogator
|
from troveclient.diagnostics import HwInfoInterrogator # noqa
|
||||||
from troveclient.client import Dbaas
|
from troveclient.client import Dbaas # noqa
|
||||||
from troveclient.client import TroveHTTPClient
|
from troveclient.client import TroveHTTPClient # noqa
|
||||||
|
@@ -128,23 +128,6 @@ class Auth1_1(Authenticator):
|
|||||||
"key": self.password}}
|
"key": self.password}}
|
||||||
return self._authenticate(auth_url, body, root_key='auth')
|
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):
|
class RaxAuthenticator(Authenticator):
|
||||||
|
|
||||||
|
@@ -18,8 +18,6 @@
|
|||||||
Trove Command line tool
|
Trove Command line tool
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#TODO(tim.simpson): optparse is deprecated. Replace with argparse.
|
|
||||||
import optparse
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@@ -130,7 +130,6 @@ class TroveHTTPClient(httplib2.Http):
|
|||||||
_logger.debug("RESP:%s %s\n", resp, body)
|
_logger.debug("RESP:%s %s\n", resp, body)
|
||||||
|
|
||||||
def pretty_log(self, args, kwargs, resp, body):
|
def pretty_log(self, args, kwargs, resp, body):
|
||||||
from troveclient import common
|
|
||||||
if not _logger.isEnabledFor(logging.DEBUG):
|
if not _logger.isEnabledFor(logging.DEBUG):
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -283,7 +282,7 @@ class Dbaas(object):
|
|||||||
|
|
||||||
Create an instance with your creds::
|
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)
|
SERVICE_URL)
|
||||||
|
|
||||||
Then call methods on its managers::
|
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 check_for_exceptions
|
||||||
from troveclient.common import limit_url
|
from troveclient.common import limit_url
|
||||||
from troveclient.common import Paginated
|
from troveclient.common import Paginated
|
||||||
import exceptions
|
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
|
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from troveclient import base
|
from troveclient import base
|
||||||
import exceptions
|
|
||||||
|
|
||||||
|
|
||||||
class Diagnostics(base.Resource):
|
class Diagnostics(base.Resource):
|
||||||
|
@@ -16,10 +16,6 @@
|
|||||||
|
|
||||||
from troveclient import base
|
from troveclient import base
|
||||||
|
|
||||||
import exceptions
|
|
||||||
|
|
||||||
from troveclient.common import check_for_exceptions
|
|
||||||
|
|
||||||
|
|
||||||
class Flavor(base.Resource):
|
class Flavor(base.Resource):
|
||||||
"""
|
"""
|
||||||
|
@@ -19,7 +19,6 @@ Trove Management Command line tool
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import optparse
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@@ -17,7 +17,6 @@ from troveclient import base
|
|||||||
|
|
||||||
from troveclient import users
|
from troveclient import users
|
||||||
from troveclient.common import check_for_exceptions
|
from troveclient.common import check_for_exceptions
|
||||||
import exceptions
|
|
||||||
|
|
||||||
|
|
||||||
class Root(base.ManagerWithFind):
|
class Root(base.ManagerWithFind):
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
import contextlib
|
|
||||||
|
|
||||||
from testtools import TestCase
|
from testtools import TestCase
|
||||||
from troveclient import auth
|
from troveclient import auth
|
||||||
|
@@ -6,7 +6,6 @@ from mock import Mock
|
|||||||
|
|
||||||
from troveclient import base
|
from troveclient import base
|
||||||
from troveclient import exceptions
|
from troveclient import exceptions
|
||||||
from troveclient import utils
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Unit tests for base.py
|
Unit tests for base.py
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
import contextlib
|
|
||||||
import os
|
|
||||||
import logging
|
import logging
|
||||||
import httplib2
|
import httplib2
|
||||||
import time
|
import time
|
||||||
@@ -9,7 +7,6 @@ from mock import Mock
|
|||||||
|
|
||||||
from troveclient import client
|
from troveclient import client
|
||||||
from troveclient import exceptions
|
from troveclient import exceptions
|
||||||
from troveclient import utils
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Unit tests for client.py
|
Unit tests for client.py
|
||||||
|
@@ -2,7 +2,6 @@ from testtools import TestCase
|
|||||||
from mock import Mock
|
from mock import Mock
|
||||||
|
|
||||||
from troveclient import security_groups
|
from troveclient import security_groups
|
||||||
from troveclient import base
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Unit tests for security_groups.py
|
Unit tests for security_groups.py
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
from testtools import TestCase
|
from testtools import TestCase
|
||||||
from troveclient import utils
|
from troveclient import utils
|
||||||
from troveclient import versions
|
|
||||||
|
|
||||||
|
|
||||||
class UtilsTest(TestCase):
|
class UtilsTest(TestCase):
|
||||||
@@ -34,7 +33,7 @@ class UtilsTest(TestCase):
|
|||||||
self.assertEqual('', utils.env('test_abcd'))
|
self.assertEqual('', utils.env('test_abcd'))
|
||||||
|
|
||||||
def test_slugify(self):
|
def test_slugify(self):
|
||||||
import unicodedata
|
import unicodedata # noqa
|
||||||
|
|
||||||
self.assertEqual('not_unicode', utils.slugify('not_unicode'))
|
self.assertEqual('not_unicode', utils.slugify('not_unicode'))
|
||||||
self.assertEqual('unicode', utils.slugify(unicode('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 limit_url
|
||||||
from troveclient.common import Paginated
|
from troveclient.common import Paginated
|
||||||
from troveclient.common import quote_user_host
|
from troveclient.common import quote_user_host
|
||||||
import exceptions
|
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
|
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
class HookableMixin(object):
|
class HookableMixin(object):
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
from lxml import etree
|
from lxml import etree
|
||||||
import json
|
|
||||||
from numbers import Number
|
from numbers import Number
|
||||||
|
|
||||||
from troveclient import exceptions
|
from troveclient import exceptions
|
||||||
|
Reference in New Issue
Block a user