Changed our minds: keep pylint equal to Ubuntu Lucid version, and use disable-msg throughout.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# pylint: disable=C0103
|
# pylint: disable-msg=C0103
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
|
|
||||||
# Copyright 2010 United States Government as represented by the
|
# Copyright 2010 United States Government as represented by the
|
||||||
|
@@ -59,7 +59,7 @@ class Connection(carrot_connection.BrokerConnection):
|
|||||||
params['backend_cls'] = fakerabbit.Backend
|
params['backend_cls'] = fakerabbit.Backend
|
||||||
|
|
||||||
# NOTE(vish): magic is fun!
|
# NOTE(vish): magic is fun!
|
||||||
# pylint: disable=W0142
|
# pylint: disable-msg=W0142
|
||||||
cls._instance = cls(**params)
|
cls._instance = cls(**params)
|
||||||
return cls._instance
|
return cls._instance
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ class Consumer(messaging.Consumer):
|
|||||||
if self.failed_connection:
|
if self.failed_connection:
|
||||||
# NOTE(vish): conn is defined in the parent class, we can
|
# NOTE(vish): conn is defined in the parent class, we can
|
||||||
# recreate it as long as we create the backend too
|
# recreate it as long as we create the backend too
|
||||||
# pylint: disable=W0201
|
# pylint: disable-msg=W0201
|
||||||
self.conn = Connection.recreate()
|
self.conn = Connection.recreate()
|
||||||
self.backend = self.conn.create_backend()
|
self.backend = self.conn.create_backend()
|
||||||
super(Consumer, self).fetch(no_ack, auto_ack, enable_callbacks)
|
super(Consumer, self).fetch(no_ack, auto_ack, enable_callbacks)
|
||||||
@@ -114,7 +114,7 @@ class Consumer(messaging.Consumer):
|
|||||||
# NOTE(vish): This is catching all errors because we really don't
|
# NOTE(vish): This is catching all errors because we really don't
|
||||||
# exceptions to be logged 10 times a second if some
|
# exceptions to be logged 10 times a second if some
|
||||||
# persistent failure occurs.
|
# persistent failure occurs.
|
||||||
except Exception: # pylint: disable=W0703
|
except Exception: # pylint: disable-msg=W0703
|
||||||
if not self.failed_connection:
|
if not self.failed_connection:
|
||||||
logging.exception("Failed to fetch message from queue")
|
logging.exception("Failed to fetch message from queue")
|
||||||
self.failed_connection = True
|
self.failed_connection = True
|
||||||
@@ -178,7 +178,7 @@ class AdapterConsumer(TopicConsumer):
|
|||||||
node_func = getattr(self.proxy, str(method))
|
node_func = getattr(self.proxy, str(method))
|
||||||
node_args = dict((str(k), v) for k, v in args.iteritems())
|
node_args = dict((str(k), v) for k, v in args.iteritems())
|
||||||
# NOTE(vish): magic is fun!
|
# NOTE(vish): magic is fun!
|
||||||
# pylint: disable=W0142
|
# pylint: disable-msg=W0142
|
||||||
d = defer.maybeDeferred(node_func, **node_args)
|
d = defer.maybeDeferred(node_func, **node_args)
|
||||||
if msg_id:
|
if msg_id:
|
||||||
d.addCallback(lambda rval: msg_reply(msg_id, rval, None))
|
d.addCallback(lambda rval: msg_reply(msg_id, rval, None))
|
||||||
|
@@ -36,7 +36,7 @@ FLAGS = flags.FLAGS
|
|||||||
|
|
||||||
class NetworkTestCase(test.TrialTestCase):
|
class NetworkTestCase(test.TrialTestCase):
|
||||||
"""Test cases for network code"""
|
"""Test cases for network code"""
|
||||||
def setUp(self): # pylint: disable=C0103
|
def setUp(self): # pylint: disable-msg=C0103
|
||||||
super(NetworkTestCase, self).setUp()
|
super(NetworkTestCase, self).setUp()
|
||||||
# NOTE(vish): if you change these flags, make sure to change the
|
# NOTE(vish): if you change these flags, make sure to change the
|
||||||
# flags in the corresponding section in nova-dhcpbridge
|
# flags in the corresponding section in nova-dhcpbridge
|
||||||
@@ -60,7 +60,7 @@ class NetworkTestCase(test.TrialTestCase):
|
|||||||
vpn.NetworkData.create(self.projects[i].id)
|
vpn.NetworkData.create(self.projects[i].id)
|
||||||
self.service = service.VlanNetworkService()
|
self.service = service.VlanNetworkService()
|
||||||
|
|
||||||
def tearDown(self): # pylint: disable=C0103
|
def tearDown(self): # pylint: disable-msg=C0103
|
||||||
super(NetworkTestCase, self).tearDown()
|
super(NetworkTestCase, self).tearDown()
|
||||||
for project in self.projects:
|
for project in self.projects:
|
||||||
self.manager.delete_project(project)
|
self.manager.delete_project(project)
|
||||||
|
@@ -56,7 +56,7 @@ os.makedirs(os.path.join(OSS_TEMPDIR, 'buckets'))
|
|||||||
class ObjectStoreTestCase(test.BaseTestCase):
|
class ObjectStoreTestCase(test.BaseTestCase):
|
||||||
"""Test objectstore API directly."""
|
"""Test objectstore API directly."""
|
||||||
|
|
||||||
def setUp(self): # pylint: disable=C0103
|
def setUp(self): # pylint: disable-msg=C0103
|
||||||
"""Setup users and projects."""
|
"""Setup users and projects."""
|
||||||
super(ObjectStoreTestCase, self).setUp()
|
super(ObjectStoreTestCase, self).setUp()
|
||||||
self.flags(buckets_path=os.path.join(OSS_TEMPDIR, 'buckets'),
|
self.flags(buckets_path=os.path.join(OSS_TEMPDIR, 'buckets'),
|
||||||
@@ -78,7 +78,7 @@ class ObjectStoreTestCase(test.BaseTestCase):
|
|||||||
|
|
||||||
self.context = Context()
|
self.context = Context()
|
||||||
|
|
||||||
def tearDown(self): # pylint: disable=C0103
|
def tearDown(self): # pylint: disable-msg=C0103
|
||||||
"""Tear down users and projects."""
|
"""Tear down users and projects."""
|
||||||
self.auth_manager.delete_project('proj1')
|
self.auth_manager.delete_project('proj1')
|
||||||
self.auth_manager.delete_project('proj2')
|
self.auth_manager.delete_project('proj2')
|
||||||
@@ -168,7 +168,7 @@ class ObjectStoreTestCase(test.BaseTestCase):
|
|||||||
class TestHTTPChannel(http.HTTPChannel):
|
class TestHTTPChannel(http.HTTPChannel):
|
||||||
"""Dummy site required for twisted.web"""
|
"""Dummy site required for twisted.web"""
|
||||||
|
|
||||||
def checkPersistence(self, _, __): # pylint: disable=C0103
|
def checkPersistence(self, _, __): # pylint: disable-msg=C0103
|
||||||
"""Otherwise we end up with an unclean reactor."""
|
"""Otherwise we end up with an unclean reactor."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ class TestSite(server.Site):
|
|||||||
class S3APITestCase(test.TrialTestCase):
|
class S3APITestCase(test.TrialTestCase):
|
||||||
"""Test objectstore through S3 API."""
|
"""Test objectstore through S3 API."""
|
||||||
|
|
||||||
def setUp(self): # pylint: disable=C0103
|
def setUp(self): # pylint: disable-msg=C0103
|
||||||
"""Setup users, projects, and start a test server."""
|
"""Setup users, projects, and start a test server."""
|
||||||
super(S3APITestCase, self).setUp()
|
super(S3APITestCase, self).setUp()
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ class S3APITestCase(test.TrialTestCase):
|
|||||||
|
|
||||||
root = S3()
|
root = S3()
|
||||||
self.site = TestSite(root)
|
self.site = TestSite(root)
|
||||||
# pylint: disable=E1101
|
# pylint: disable-msg=E1101
|
||||||
self.listening_port = reactor.listenTCP(0, self.site,
|
self.listening_port = reactor.listenTCP(0, self.site,
|
||||||
interface='127.0.0.1')
|
interface='127.0.0.1')
|
||||||
# pylint: enable-msg=E1101
|
# pylint: enable-msg=E1101
|
||||||
@@ -221,11 +221,11 @@ class S3APITestCase(test.TrialTestCase):
|
|||||||
|
|
||||||
self.conn.get_http_connection = get_http_connection
|
self.conn.get_http_connection = get_http_connection
|
||||||
|
|
||||||
def _ensure_no_buckets(self, buckets): # pylint: disable=C0111
|
def _ensure_no_buckets(self, buckets): # pylint: disable-msg=C0111
|
||||||
self.assertEquals(len(buckets), 0, "Bucket list was not empty")
|
self.assertEquals(len(buckets), 0, "Bucket list was not empty")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _ensure_one_bucket(self, buckets, name): # pylint: disable=C0111
|
def _ensure_one_bucket(self, buckets, name): # pylint: disable-msg=C0111
|
||||||
self.assertEquals(len(buckets), 1,
|
self.assertEquals(len(buckets), 1,
|
||||||
"Bucket list didn't have exactly one element in it")
|
"Bucket list didn't have exactly one element in it")
|
||||||
self.assertEquals(buckets[0].name, name, "Wrong name")
|
self.assertEquals(buckets[0].name, name, "Wrong name")
|
||||||
@@ -296,7 +296,7 @@ class S3APITestCase(test.TrialTestCase):
|
|||||||
deferred.addCallback(self._ensure_no_buckets)
|
deferred.addCallback(self._ensure_no_buckets)
|
||||||
return deferred
|
return deferred
|
||||||
|
|
||||||
def tearDown(self): # pylint: disable=C0103
|
def tearDown(self): # pylint: disable-msg=C0103
|
||||||
"""Tear down auth and test server."""
|
"""Tear down auth and test server."""
|
||||||
self.auth_manager.delete_user('admin')
|
self.auth_manager.delete_user('admin')
|
||||||
self.auth_manager.delete_project('admin')
|
self.auth_manager.delete_project('admin')
|
||||||
|
@@ -32,7 +32,7 @@ FLAGS = flags.FLAGS
|
|||||||
|
|
||||||
class RpcTestCase(test.BaseTestCase):
|
class RpcTestCase(test.BaseTestCase):
|
||||||
"""Test cases for rpc"""
|
"""Test cases for rpc"""
|
||||||
def setUp(self): # pylint: disable=C0103
|
def setUp(self): # pylint: disable-msg=C0103
|
||||||
super(RpcTestCase, self).setUp()
|
super(RpcTestCase, self).setUp()
|
||||||
self.conn = rpc.Connection.instance()
|
self.conn = rpc.Connection.instance()
|
||||||
self.receiver = TestReceiver()
|
self.receiver = TestReceiver()
|
||||||
|
Reference in New Issue
Block a user