From 269c7fb6f9e3c820d93163a904672956f756b1f5 Mon Sep 17 00:00:00 2001 From: Eyal Date: Thu, 11 Oct 2018 12:12:54 +0300 Subject: [PATCH] dont use rabbit_hosts on conf it was removed from oslo messaging in the last version use some uuid we dont use it Change-Id: If14e94b39996cfaac040a7a765dd797e8b2f5f61 --- requirements.txt | 3 ++- vitrage/entity_graph/workers.py | 4 ++-- vitrage/rpc.py | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 4407e2714..d1d15e770 100644 --- a/requirements.txt +++ b/requirements.txt @@ -47,4 +47,5 @@ six>=1.11.0 # MIT debtcollector>=1.19.0 # Apache-2.0 cotyledon>=1.6.8 # Apache-2.0 futures>=3.0.0;python_version=='2.7' or python_version=='2.6' # BSD -pytz>=2013.6 # MIT \ No newline at end of file +pytz>=2013.6 # MIT +tenacity>=4.9.0 \ No newline at end of file diff --git a/vitrage/entity_graph/workers.py b/vitrage/entity_graph/workers.py index e6c6527c5..0381cbf44 100644 --- a/vitrage/entity_graph/workers.py +++ b/vitrage/entity_graph/workers.py @@ -19,6 +19,7 @@ from six.moves import _thread from oslo_concurrency import processutils as ps from oslo_log import log import oslo_messaging +from oslo_utils import uuidutils from vitrage.api_handler.apis.alarm import AlarmApis from vitrage.api_handler.apis.event import EventApis @@ -377,9 +378,8 @@ class ApiWorker(GraphCloneWorkerBase): [EVALUATOR_TOPIC]) db = storage.get_connection_from_config(conf) transport = messaging.get_rpc_transport(conf) - rabbit_hosts = conf.oslo_messaging_rabbit.rabbit_hosts target = oslo_messaging.Target(topic=conf.rpc_topic, - server=rabbit_hosts) + server=uuidutils.generate_uuid()) endpoints = [TopologyApis(self._entity_graph, conf), AlarmApis(self._entity_graph, conf, db), diff --git a/vitrage/rpc.py b/vitrage/rpc.py index 4e874df15..1daccbcb8 100644 --- a/vitrage/rpc.py +++ b/vitrage/rpc.py @@ -18,8 +18,10 @@ from oslo_config import cfg from oslo_log import log import oslo_messaging as messaging from oslo_messaging.rpc import dispatcher +from oslo_utils import uuidutils from osprofiler import profiler + OPTS = [ cfg.StrOpt('rpc_topic', default='rpcapiv1', @@ -92,7 +94,7 @@ def get_default_server(conf, topic, endpoints): transport = messaging.get_rpc_transport(conf) target = messaging.Target( topic=topic, - server=conf.oslo_messaging_rabbit.rabbit_hosts) + server=uuidutils.generate_uuid()) return get_server(target, endpoints, transport)