Start Gating on Pyflakes and Hacking

Instead of globally ignoring Pyflakes and Hacking
warnings, only blacklist those that occur frequently
and fix the others. Start gating on those checks.

Change-Id: Ice032c16d445ef08ef018bcdc5c221ab3c323755
This commit is contained in:
Dirk Mueller 2013-06-09 11:18:02 +02:00
parent 93557c1929
commit 7359c976d1
20 changed files with 38 additions and 35 deletions

@ -104,7 +104,7 @@ class Manager(utils.HookableMixin):
cache_dir = os.path.expanduser(os.path.join(base_dir, uniqifier))
try:
os.makedirs(cache_dir, 0755)
os.makedirs(cache_dir, 0o755)
except OSError:
# NOTE(kiall): This is typicaly either permission denied while
# attempting to create the directory, or the directory

@ -207,7 +207,8 @@ class HTTPClient(object):
def _extract_service_catalog(self, url, resp, body, extract_token=True):
"""See what the auth service told us and process the response.
We may get redirected to another site, fail or actually get
back a service catalog with a token and our endpoints."""
back a service catalog with a token and our endpoints.
"""
if resp.status_code == 200: # content must always present
try:

@ -6,7 +6,8 @@ Exception definitions.
class UnsupportedVersion(Exception):
"""Indicates that the user is trying to use an unsupported
version of the API"""
version of the API.
"""
pass
@ -24,7 +25,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

@ -33,7 +33,8 @@ class ServiceCatalog(object):
service_name=None, volume_service_name=None):
"""Fetch the public URL from the Compute service for
a particular endpoint attribute. If none given, return
the first. See tests for sample service catalog."""
the first. See tests for sample service catalog.
"""
matching_endpoints = []
if 'endpoints' in self.catalog:
# We have a bastardized service catalog. Treat it special. :/
@ -44,7 +45,7 @@ class ServiceCatalog(object):
raise cinderclient.exceptions.EndpointNotFound()
# We don't always get a service catalog back ...
if not 'serviceCatalog' in self.catalog['access']:
if 'serviceCatalog' not in self.catalog['access']:
return None
# Full catalog ...

@ -1,5 +1,4 @@
import cStringIO
import os
import re
import sys

@ -79,7 +79,7 @@ class FindResourceTestCase(test_utils.TestCase):
class CaptureStdout(object):
"""Context manager for capturing stdout from statments in its's block"""
"""Context manager for capturing stdout from statments in its's block."""
def __enter__(self):
self.real_stdout = sys.stdout
self.stringio = StringIO.StringIO()

@ -23,8 +23,9 @@ class TestCase(testtools.TestCase):
class TestResponse(requests.Response):
""" Class used to wrap requests.Response and provide some
convenience to initialize with a dict """
"""Class used to wrap requests.Response and provide some
convenience to initialize with a dict.
"""
def __init__(self, data):
self._text = None

@ -15,8 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
import fixtures
from cinderclient import client

@ -1,4 +1,3 @@
from cinderclient import exceptions
from cinderclient.v1 import volume_types
from cinderclient.tests import utils
from cinderclient.tests.v1 import fakes

@ -14,4 +14,4 @@
# License for the specific language governing permissions and limitations
# under the License.
from cinderclient.v1.client import Client
from cinderclient.v1.client import Client # noqa

@ -4,7 +4,7 @@ from cinderclient import base
class Limits(base.Resource):
"""A collection of RateLimit and AbsoluteLimit objects"""
"""A collection of RateLimit and AbsoluteLimit objects."""
def __repr__(self):
return "<Limits>"
@ -26,7 +26,7 @@ class Limits(base.Resource):
class RateLimit(object):
"""Data model that represents a flattened view of a single rate limit"""
"""Data model that represents a flattened view of a single rate limit."""
def __init__(self, verb, uri, regex, value, remain,
unit, next_available):
@ -52,7 +52,7 @@ class RateLimit(object):
class AbsoluteLimit(object):
"""Data model that represents a single absolute limit"""
"""Data model that represents a single absolute limit."""
def __init__(self, name, value):
self.name = name
@ -66,7 +66,7 @@ class AbsoluteLimit(object):
class LimitsManager(base.Manager):
"""Manager object used to interact with limits resource"""
"""Manager object used to interact with limits resource."""
resource_class = Limits

@ -21,7 +21,8 @@ class QuotaClassSet(base.Resource):
@property
def id(self):
"""QuotaClassSet does not have a 'id' attribute but base.Resource
needs it to self-refresh and QuotaSet is indexed by class_name"""
needs it to self-refresh and QuotaSet is indexed by class_name.
"""
return self.class_name
def update(self, *args, **kwargs):

@ -20,8 +20,9 @@ class QuotaSet(base.Resource):
@property
def id(self):
"""QuotaSet does not have a 'id' attribute but base.Resource needs it
to self-refresh and QuotaSet is indexed by tenant_id"""
"""QuotaSet does not have a 'id' attribute but base. Resource needs it
to self-refresh and QuotaSet is indexed by tenant_id.
"""
return self.tenant_id
def update(self, *args, **kwargs):

@ -462,7 +462,7 @@ def do_type_create(cs, args):
help="Unique ID of the volume type to delete")
@utils.service_type('volume')
def do_type_delete(cs, args):
"""Delete a specific volume type"""
"""Delete a specific volume type."""
cs.volume_types.delete(args.id)
@ -493,14 +493,14 @@ def do_type_key(cs, args):
def do_endpoints(cs, args):
"""Discover endpoints that get returned from the authenticate services"""
"""Discover endpoints that get returned from the authenticate services."""
catalog = cs.client.service_catalog.catalog
for e in catalog['access']['serviceCatalog']:
utils.print_dict(e['endpoints'][0], e['name'])
def do_credentials(cs, args):
"""Show user credentials returned from auth"""
"""Show user credentials returned from auth."""
catalog = cs.client.service_catalog.catalog
utils.print_dict(catalog['access']['user'], "User Credentials")
utils.print_dict(catalog['access']['token'], "Token")

@ -14,4 +14,4 @@
# License for the specific language governing permissions and limitations
# under the License.
from cinderclient.v2.client import Client
from cinderclient.v2.client import Client # noqa

@ -4,7 +4,7 @@ from cinderclient import base
class Limits(base.Resource):
"""A collection of RateLimit and AbsoluteLimit objects"""
"""A collection of RateLimit and AbsoluteLimit objects."""
def __repr__(self):
return "<Limits>"
@ -26,7 +26,7 @@ class Limits(base.Resource):
class RateLimit(object):
"""Data model that represents a flattened view of a single rate limit"""
"""Data model that represents a flattened view of a single rate limit."""
def __init__(self, verb, uri, regex, value, remain,
unit, next_available):
@ -52,7 +52,7 @@ class RateLimit(object):
class AbsoluteLimit(object):
"""Data model that represents a single absolute limit"""
"""Data model that represents a single absolute limit."""
def __init__(self, name, value):
self.name = name
@ -66,7 +66,7 @@ class AbsoluteLimit(object):
class LimitsManager(base.Manager):
"""Manager object used to interact with limits resource"""
"""Manager object used to interact with limits resource."""
resource_class = Limits

@ -20,7 +20,7 @@ class QuotaClassSet(base.Resource):
@property
def id(self):
"""Needed by base.Resource to self-refresh and be indexed"""
"""Needed by base.Resource to self-refresh and be indexed."""
return self.class_name
def update(self, *args, **kwargs):

@ -20,7 +20,7 @@ class QuotaSet(base.Resource):
@property
def id(self):
"""Needed by base.Resource to self-refresh and be indexed"""
"""Needed by base.Resource to self-refresh and be indexed."""
return self.tenant_id
def update(self, *args, **kwargs):

@ -507,7 +507,7 @@ def do_type_create(cs, args):
help="Unique ID of the volume type to delete")
@utils.service_type('volume')
def do_type_delete(cs, args):
"""Delete a specific volume type"""
"""Delete a specific volume type."""
cs.volume_types.delete(args.id)
@ -537,14 +537,14 @@ def do_type_key(cs, args):
def do_endpoints(cs, args):
"""Discover endpoints that get returned from the authenticate services"""
"""Discover endpoints that get returned from the authenticate services."""
catalog = cs.client.service_catalog.catalog
for e in catalog['access']['serviceCatalog']:
utils.print_dict(e['endpoints'][0], e['name'])
def do_credentials(cs, args):
"""Show user credentials returned from auth"""
"""Show user credentials returned from auth."""
catalog = cs.client.service_catalog.catalog
utils.print_dict(catalog['access']['user'], "User Credentials")
utils.print_dict(catalog['access']['token'], "Token")

@ -25,5 +25,5 @@ downloadcache = ~/cache/pip
[flake8]
show-source = True
ignore = F,H
ignore = F811,F821,H302,H306,H404
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools