From d06dcc69f5fb75e8c1e077665bce227be9edc203 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 14 Jun 2013 17:15:52 +0200 Subject: [PATCH] Enable pep8 H403 checks What a better thing to do on a Friday afternoon to chill out before the week-end? Change-Id: Ie264d2bff02794d80ddbecb95a6b2ff9a3840d44 --- ceilometer/agent.py | 6 ++++-- ceilometer/compute/notifications.py | 3 ++- ceilometer/compute/plugin.py | 8 ++++---- ceilometer/image/notifications.py | 3 ++- ceilometer/network/notifications.py | 6 ++++-- ceilometer/plugin.py | 11 +++++++---- ceilometer/transformer/__init__.py | 3 ++- ceilometer/transformer/accumulator.py | 4 +++- ceilometer/volume/notifications.py | 3 ++- tests/api/v2/test_post_samples.py | 3 ++- tox.ini | 2 +- 11 files changed, 33 insertions(+), 19 deletions(-) diff --git a/ceilometer/agent.py b/ceilometer/agent.py index cc1588b20..e4f724056 100644 --- a/ceilometer/agent.py +++ b/ceilometer/agent.py @@ -31,8 +31,10 @@ LOG = log.getLogger(__name__) class PollingTask(object): - """Polling task for polling counters and inject into pipeline - A polling task can be invoked periodically or only once""" + """Polling task for polling counters and inject into pipeline. + A polling task can be invoked periodically or only once. + + """ def __init__(self, agent_manager): self.manager = agent_manager diff --git a/ceilometer/compute/notifications.py b/ceilometer/compute/notifications.py index af39c4e21..f46d11c57 100644 --- a/ceilometer/compute/notifications.py +++ b/ceilometer/compute/notifications.py @@ -43,7 +43,8 @@ class ComputeNotificationBase(plugin.NotificationBase): @staticmethod def get_exchange_topics(conf): """Return a sequence of ExchangeTopics defining the exchange and - topics to be connected for this plugin.""" + topics to be connected for this plugin. + """ return [ plugin.ExchangeTopics( exchange=conf.nova_control_exchange, diff --git a/ceilometer/compute/plugin.py b/ceilometer/compute/plugin.py index 7d393237a..6a7c6c7dd 100644 --- a/ceilometer/compute/plugin.py +++ b/ceilometer/compute/plugin.py @@ -24,12 +24,12 @@ from ceilometer import plugin class ComputePollster(plugin.PollsterBase): - """Base class for plugins that support the polling API on the - compute node.""" + """Base class for plugins that support the polling API on the compute node. + """ __metaclass__ = abc.ABCMeta @abc.abstractmethod def get_counters(self, manager, context): - """Return a sequence of Counter instances from polling the - resources.""" + """Return a sequence of Counter instances from polling the resources. + """ diff --git a/ceilometer/image/notifications.py b/ceilometer/image/notifications.py index ce1c6bc4f..eba943bf4 100644 --- a/ceilometer/image/notifications.py +++ b/ceilometer/image/notifications.py @@ -40,7 +40,8 @@ class ImageBase(plugin.NotificationBase): @staticmethod def get_exchange_topics(conf): """Return a sequence of ExchangeTopics defining the exchange and - topics to be connected for this plugin.""" + topics to be connected for this plugin. + """ return [ plugin.ExchangeTopics( exchange=conf.glance_control_exchange, diff --git a/ceilometer/network/notifications.py b/ceilometer/network/notifications.py index 0a8892050..4686457b5 100644 --- a/ceilometer/network/notifications.py +++ b/ceilometer/network/notifications.py @@ -57,8 +57,10 @@ class NetworkNotificationBase(plugin.NotificationBase): @staticmethod def get_exchange_topics(conf): - """Return a sequence of ExchangeTopics defining the exchange and - topics to be connected for this plugin.""" + """Return a sequence of ExchangeTopics defining the exchange and topics + to be connected for this plugin. + + """ return [ plugin.ExchangeTopics( exchange=conf.quantum_control_exchange, diff --git a/ceilometer/plugin.py b/ceilometer/plugin.py index 8e0267019..32f0c7339 100644 --- a/ceilometer/plugin.py +++ b/ceilometer/plugin.py @@ -51,7 +51,8 @@ class NotificationBase(PluginBase): @abc.abstractmethod def get_event_types(self): """Return a sequence of strings defining the event types to be - given to this plugin.""" + given to this plugin. + """ @abc.abstractmethod def get_exchange_topics(self, conf): @@ -65,7 +66,8 @@ class NotificationBase(PluginBase): def process_notification(self, message): """Return a sequence of Counter instances for the given message. - :param message: Message to process.""" + :param message: Message to process. + """ def notification_to_metadata(self, event): """Transform a payload dict to a metadata dict.""" @@ -87,5 +89,6 @@ class PollsterBase(PluginBase): @abc.abstractmethod def get_counters(self, manager, instance): - """Return a sequence of Counter instances from polling the - resources.""" + """Return a sequence of Counter instances from polling the resources. + + """ diff --git a/ceilometer/transformer/__init__.py b/ceilometer/transformer/__init__.py index 95d7890be..176ef0b47 100644 --- a/ceilometer/transformer/__init__.py +++ b/ceilometer/transformer/__init__.py @@ -65,5 +65,6 @@ class TransformerBase(object): """Flush counters cached previously. :param context: Passed from the data collector. - :param source: Source of counters that are being published.""" + :param source: Source of counters that are being published. + """ return [] diff --git a/ceilometer/transformer/accumulator.py b/ceilometer/transformer/accumulator.py index c193b3cff..1ae280083 100644 --- a/ceilometer/transformer/accumulator.py +++ b/ceilometer/transformer/accumulator.py @@ -21,7 +21,9 @@ from ceilometer import transformer class TransformerAccumulator(transformer.TransformerBase): """Transformer that accumulates counter until a threshold, and then flush - them out in the wild. """ + them out in the wild. + + """ def __init__(self, size=1, **kwargs): if size >= 1: diff --git a/ceilometer/volume/notifications.py b/ceilometer/volume/notifications.py index b5ccdcffe..a756d3580 100644 --- a/ceilometer/volume/notifications.py +++ b/ceilometer/volume/notifications.py @@ -49,7 +49,8 @@ class _Base(plugin.NotificationBase): @staticmethod def get_exchange_topics(conf): """Return a sequence of ExchangeTopics defining the exchange and - topics to be connected for this plugin.""" + topics to be connected for this plugin. + """ return [ plugin.ExchangeTopics( exchange=conf.cinder_control_exchange, diff --git a/tests/api/v2/test_post_samples.py b/tests/api/v2/test_post_samples.py index 7be9a01cf..03dbfb2d2 100644 --- a/tests/api/v2/test_post_samples.py +++ b/tests/api/v2/test_post_samples.py @@ -174,7 +174,8 @@ class TestPostSamples(FunctionalTest): def test_multiple_samples_some_null_sources(self): """Do accept a single post with some null sources this is a convience feature so you only have to set - one of the sample's source field.""" + one of the sample's source field. + """ s1 = [{'counter_name': 'my_counter_name', 'counter_type': 'gauge', 'counter_unit': 'instance', diff --git a/tox.ini b/tox.ini index 14596484b..7cce351c5 100644 --- a/tox.ini +++ b/tox.ini @@ -40,7 +40,7 @@ deps = -r{toxinidir}/requirements.txt commands = {posargs} [flake8] -ignore = E125,F403,H301,H302,H304,H306,H401,H402,H403 +ignore = E125,F403,H301,H302,H304,H306,H401,H402 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,nova_tests show-source = True