From 9e3eb1336fbcd3de186738b9119f97e9f448afca Mon Sep 17 00:00:00 2001 From: kgriffs Date: Thu, 23 Jan 2014 11:31:22 -0600 Subject: [PATCH] chore: Fix pylint errors Fixed a couple pylint errors and disabled remaining false positives. Change-Id: Ib7e6f42e98f31af1c731c0b69fd26de1572b4471 --- marconi/queues/storage/sharding.py | 5 ++++- marconi/queues/transport/base.py | 2 +- marconi/tests/functional/base.py | 1 + marconi/tests/queues/storage/base.py | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/marconi/queues/storage/sharding.py b/marconi/queues/storage/sharding.py index e203deda1..7ad95d686 100644 --- a/marconi/queues/storage/sharding.py +++ b/marconi/queues/storage/sharding.py @@ -368,7 +368,10 @@ class Catalog(object): # NOTE(cpp-cabrera): parse general opts: 'drivers' uri = shard['uri'] + + # pylint: disable=no-member storage_type = six.moves.urllib_parse.urlparse(uri).scheme + driver_dict_opts = {'storage': storage_type} driver_opts = common_utils.dict_to_conf(driver_dict_opts) @@ -437,7 +440,7 @@ class Catalog(object): shard = select.weighted(self._shards_ctrl.list(limit=0)) if not shard: - raise errors.NoShardsFound() + raise errors.NoShardFound() self._catalogue_ctrl.insert(project, queue, shard['name']) diff --git a/marconi/queues/transport/base.py b/marconi/queues/transport/base.py index 7d54542bf..7ad612da4 100644 --- a/marconi/queues/transport/base.py +++ b/marconi/queues/transport/base.py @@ -52,6 +52,6 @@ class DriverBase(object): self._conf.register_opts(_TRANSPORT_OPTIONS) @abc.abstractmethod - def listen(): + def listen(self): """Start listening for client requests (self-hosting mode).""" raise NotImplementedError diff --git a/marconi/tests/functional/base.py b/marconi/tests/functional/base.py index 795a20577..9683412d1 100644 --- a/marconi/tests/functional/base.py +++ b/marconi/tests/functional/base.py @@ -54,6 +54,7 @@ class FunctionalTestBase(testing.TestBase): # NOTE(flaper87): Use running instances. if self.cfg.marconi.run_server: if not (self.server and self.server.is_alive()): + # pylint: disable=not-callable self.server = self.server_class() self.server.start(self.mconf) diff --git a/marconi/tests/queues/storage/base.py b/marconi/tests/queues/storage/base.py index 5b5d778e7..2016c50e0 100644 --- a/marconi/tests/queues/storage/base.py +++ b/marconi/tests/queues/storage/base.py @@ -49,11 +49,14 @@ class ControllerBaseTest(testing.TestBase): oslo_cache.register_oslo_configs(self.conf) cache = oslo_cache.get_cache(self.conf.cache_url) + + # pylint: disable=not-callable self.driver = self.driver_class(self.conf, cache) self._prepare_conf() self.addCleanup(self._purge_databases) + # pylint: disable=not-callable self.controller = self.controller_class(self.driver) def _prepare_conf(self):