Removed status_topic config parameter

In this changeset, I removed the now obsolete status_topic config
option.

DocImpact
Partially Implements: blueprint watcher-notifications-ovo

Change-Id: Icfc03abd875b77fc456bfa286ac2b5774651e8fa
This commit is contained in:
Vincent Françoise
2016-11-09 17:04:50 +01:00
parent 395ccbd94c
commit cdda06c08c
9 changed files with 42 additions and 111 deletions

View File

@@ -33,13 +33,11 @@ class DummyManager(object):
API_VERSION = '1.0'
conductor_endpoints = [mock.Mock()]
status_endpoints = [mock.Mock()]
notification_endpoints = [mock.Mock()]
def __init__(self):
self.publisher_id = "pub_id"
self.conductor_topic = "conductor_topic"
self.status_topic = "status_topic"
self.notification_topics = []
self.api_version = self.API_VERSION
self.service_name = None
@@ -85,13 +83,13 @@ class TestService(base.TestCase):
def test_start(self, m_handler):
dummy_service = service.Service(DummyManager)
dummy_service.start()
self.assertEqual(2, m_handler.call_count)
self.assertEqual(1, m_handler.call_count)
@mock.patch.object(om.rpc.server, "RPCServer")
def test_stop(self, m_handler):
dummy_service = service.Service(DummyManager)
dummy_service.stop()
self.assertEqual(2, m_handler.call_count)
self.assertEqual(1, m_handler.call_count)
def test_build_topic_handler(self):
topic_name = "mytopic"
@@ -108,6 +106,3 @@ class TestService(base.TestCase):
self.assertIsInstance(
dummy_service.conductor_topic_handler,
om.rpc.server.RPCServer)
self.assertIsInstance(
dummy_service.status_topic_handler,
om.rpc.server.RPCServer)

View File

@@ -16,30 +16,44 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from watcher.common import service_manager
from watcher.decision_engine.model.notification import nova as novanotification
from watcher.tests.decision_engine.model import faker_cluster_state
class FakeManager(object):
class FakeManager(service_manager.ServiceManager):
API_VERSION = '1.0'
def __init__(self):
self.api_version = self.API_VERSION
self.service_name = None
fake_cdmc = faker_cluster_state.FakerModelCollector()
# fake cluster instead on Nova CDM
self.fake_cdmc = faker_cluster_state.FakerModelCollector()
@property
def service_name(self):
return 'watcher-fake'
self.publisher_id = 'test_publisher_id'
self.conductor_topic = 'test_conductor_topic'
self.status_topic = 'test_status_topic'
self.notification_topics = ['nova']
@property
def api_version(self):
return self.API_VERSION
self.conductor_endpoints = [] # Disable audit endpoint
self.status_endpoints = []
@property
def publisher_id(self):
return 'test_publisher_id'
self.notification_endpoints = [
@property
def conductor_topic(self):
return 'test_conductor_topic'
@property
def notification_topics(self):
return ['nova']
@property
def conductor_endpoints(self):
return [] # Disable audit endpoint
@property
def notification_endpoints(self):
return [
novanotification.ServiceUpdated(self.fake_cdmc),
novanotification.InstanceCreated(self.fake_cdmc),

View File

@@ -31,9 +31,9 @@ from watcher.tests.decision_engine.model.notification import fake_managers
class DummyManager(fake_managers.FakeManager):
def __init__(self):
super(DummyManager, self).__init__()
self.notification_endpoints = [DummyNotification(self.fake_cdmc)]
@property
def notification_endpoints(self):
return [DummyNotification(self.fake_cdmc)]
class DummyNotification(base.NotificationEndpoint):