Move aodh.alarm.rpc to aodh.rpc
Change-Id: I54367f3edfee7b983f0a4a6de0495a1b5b5fa96a
This commit is contained in:
parent
bf9a116384
commit
cf53ba65ed
@ -14,11 +14,11 @@
|
||||
import itertools
|
||||
|
||||
import aodh.alarm.notifier.rest
|
||||
import aodh.alarm.rpc
|
||||
import aodh.api
|
||||
import aodh.api.app
|
||||
import aodh.api.controllers.v2.alarms
|
||||
import aodh.coordination
|
||||
import aodh.rpc
|
||||
import aodh.service
|
||||
import aodh.storage
|
||||
|
||||
@ -28,10 +28,10 @@ def list_opts():
|
||||
('DEFAULT',
|
||||
itertools.chain(aodh.api.app.OPTS,
|
||||
aodh.service.OPTS,
|
||||
aodh.rpc.OPTS,
|
||||
aodh.storage.OLD_OPTS,)),
|
||||
('alarm',
|
||||
itertools.chain(aodh.alarm.notifier.rest.OPTS,
|
||||
aodh.alarm.rpc.OPTS,
|
||||
aodh.alarm.evaluator.gnocchi.OPTS,
|
||||
aodh.api.controllers.v2.alarms.ALARM_API_OPTS)),
|
||||
('api',
|
||||
|
@ -27,11 +27,12 @@ from aodh.storage import models
|
||||
OPTS = [
|
||||
cfg.StrOpt('notifier_rpc_topic',
|
||||
default='alarm_notifier',
|
||||
deprecated_group='alarm',
|
||||
help='The topic that aodh uses for alarm notifier '
|
||||
'messages.'),
|
||||
]
|
||||
|
||||
cfg.CONF.register_opts(OPTS, group='alarm')
|
||||
cfg.CONF.register_opts(OPTS)
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
@ -40,7 +41,7 @@ class RPCAlarmNotifier(object):
|
||||
def __init__(self):
|
||||
transport = messaging.get_transport()
|
||||
self.client = messaging.get_rpc_client(
|
||||
transport, topic=cfg.CONF.alarm.notifier_rpc_topic,
|
||||
transport, topic=cfg.CONF.notifier_rpc_topic,
|
||||
version="1.0")
|
||||
|
||||
def notify(self, alarm, previous, reason, reason_data):
|
@ -27,10 +27,10 @@ from oslo_utils import netutils
|
||||
import six
|
||||
from stevedore import extension
|
||||
|
||||
from aodh.alarm import rpc as rpc_alarm
|
||||
from aodh import coordination
|
||||
from aodh.i18n import _
|
||||
from aodh import messaging
|
||||
from aodh import rpc
|
||||
from aodh import storage
|
||||
from aodh import utils
|
||||
|
||||
@ -152,7 +152,7 @@ class AlarmService(object):
|
||||
self.evaluators = extension.ExtensionManager(
|
||||
namespace=self.EVALUATOR_EXTENSIONS_NAMESPACE,
|
||||
invoke_on_load=True,
|
||||
invoke_args=(rpc_alarm.RPCAlarmNotifier(),)
|
||||
invoke_args=(rpc.RPCAlarmNotifier(),)
|
||||
)
|
||||
|
||||
def _evaluate_assigned_alarms(self):
|
||||
@ -227,7 +227,7 @@ class AlarmNotifierService(os_service.Service):
|
||||
super(AlarmNotifierService, self).__init__()
|
||||
transport = messaging.get_transport()
|
||||
self.rpc_server = messaging.get_rpc_server(
|
||||
transport, cfg.CONF.alarm.notifier_rpc_topic, self)
|
||||
transport, cfg.CONF.notifier_rpc_topic, self)
|
||||
|
||||
self.notifiers = extension.ExtensionManager(
|
||||
self.NOTIFIER_EXTENSIONS_NAMESPACE,
|
||||
|
@ -21,8 +21,8 @@ from ceilometerclient.v2 import alarms
|
||||
from oslo_config import fixture as fixture_config
|
||||
import six
|
||||
|
||||
from aodh.alarm import rpc as rpc_alarm
|
||||
from aodh import messaging
|
||||
from aodh import rpc
|
||||
from aodh.storage import models
|
||||
from aodh.tests import base as tests_base
|
||||
|
||||
@ -50,7 +50,7 @@ class TestRPCAlarmNotifier(tests_base.BaseTestCase):
|
||||
self.setup_messaging(self.CONF)
|
||||
|
||||
self.notifier_server = FakeNotifier(self.transport)
|
||||
self.notifier = rpc_alarm.RPCAlarmNotifier()
|
||||
self.notifier = rpc.RPCAlarmNotifier()
|
||||
self.alarms = [
|
||||
alarms.Alarm(None, info={
|
||||
'name': 'instance_running_hot',
|
Loading…
x
Reference in New Issue
Block a user