From ca3c6d079bf3cfa13b9091444fb1d802db79718d Mon Sep 17 00:00:00 2001 From: gordon chung Date: Mon, 23 Feb 2015 15:10:33 -0500 Subject: [PATCH] fix inline multiple assignment cdent took me to school: multiple inline assignments will share same target and this is bad. this patch applies the lesson i've been taught Change-Id: I8b4767597796474f1923e872f4fe0692f3da9fda Closes-Bug: #1424807 --- ceilometer/notification.py | 4 ++-- ceilometer/tests/api/v2/test_event_scenarios.py | 3 ++- ceilometer/tests/test_notification.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ceilometer/notification.py b/ceilometer/notification.py index 315e56b62..33159602e 100644 --- a/ceilometer/notification.py +++ b/ceilometer/notification.py @@ -73,7 +73,7 @@ class NotificationService(os_service.Service): def __init__(self, *args, **kwargs): super(NotificationService, self).__init__(*args, **kwargs) self.partition_coordinator = None - self.listeners = self.pipeline_listeners = [] + self.listeners, self.pipeline_listeners = [], [] self.group_id = None @classmethod @@ -127,7 +127,7 @@ class NotificationService(os_service.Service): event_transporter = self.event_pipeline_manager self.group_id = None - self.listeners = self.pipeline_listeners = [] + self.listeners, self.pipeline_listeners = [], [] self._configure_main_queue_listeners(transporter, event_transporter) if cfg.CONF.notification.workload_partitioning: diff --git a/ceilometer/tests/api/v2/test_event_scenarios.py b/ceilometer/tests/api/v2/test_event_scenarios.py index 9f919a5e7..65f2fb6ac 100644 --- a/ceilometer/tests/api/v2/test_event_scenarios.py +++ b/ceilometer/tests/api/v2/test_event_scenarios.py @@ -35,7 +35,8 @@ class EventTestBase(v2.FunctionalTest, def _generate_models(self): event_models = [] base = 0 - self.s_time = self.trait_time = datetime.datetime(2013, 12, 31, 5, 0) + self.s_time = datetime.datetime(2013, 12, 31, 5, 0) + self.trait_time = datetime.datetime(2013, 12, 31, 5, 0) for event_type in ['Foo', 'Bar', 'Zoo']: trait_models = [models.Trait(name, type, value) for name, type, value in [ diff --git a/ceilometer/tests/test_notification.py b/ceilometer/tests/test_notification.py index 17dbe078c..cbd0ea217 100644 --- a/ceilometer/tests/test_notification.py +++ b/ceilometer/tests/test_notification.py @@ -221,7 +221,7 @@ class BaseRealNotification(tests_base.BaseTestCase): len(self.publisher.events) >= self.expected_events): break eventlet.sleep(0) - + self.assertNotEqual(self.srv.listeners, self.srv.pipeline_listeners) self.srv.stop() resources = list(set(s.resource_id for s in self.publisher.samples))