try cotyledon
Depends-On: Id4e3b9c866b867f9e9a1f03d05d22ac53c270b86 Change-Id: I928d6c570061afd1e684808e74cefca7672b31d1
This commit is contained in:
parent
5c4bd36e80
commit
6acd8b2b8d
@ -139,3 +139,4 @@ WebOb==1.7.4
|
||||
WebTest==2.0.29
|
||||
Werkzeug==0.14.1
|
||||
wrapt==1.10.11
|
||||
futures==3.0.0
|
||||
|
@ -2,48 +2,47 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
Babel!=2.4.0,>=2.3.4 # BSD
|
||||
lxml!=3.7.0,>=3.4.1 # BSD
|
||||
PyMySQL>=0.7.6 # MIT License
|
||||
aodhclient>=0.9.0 # Apache-2.0
|
||||
python-ceilometerclient>=2.5.0 # Apache-2.0
|
||||
python-cinderclient>=3.3.0 # Apache-2.0
|
||||
python-dateutil>=2.5.3 # BSD
|
||||
python-keystoneclient>=3.8.0 # Apache-2.0
|
||||
pbr>=3.1.1 # Apache-2.0
|
||||
Babel>=2.5.3 # BSD
|
||||
lxml>=4.1.1 # BSD
|
||||
PyMySQL>=0.8.0 # MIT License
|
||||
aodhclient>=1.0.0 # Apache-2.0
|
||||
python-ceilometerclient>=2.9.0 # Apache-2.0
|
||||
python-cinderclient>=3.5.0 # Apache-2.0
|
||||
python-dateutil>=2.7.0 # BSD
|
||||
python-keystoneclient>=3.15.0 # Apache-2.0
|
||||
python-neutronclient>=6.7.0 # Apache-2.0
|
||||
python-novaclient>=9.1.0 # Apache-2.0
|
||||
python-heatclient>=1.10.0 # Apache-2.0
|
||||
python-mistralclient!=3.2.0,>=3.1.0 # Apache-2.0
|
||||
python-novaclient>=10.1.0 # Apache-2.0
|
||||
python-heatclient>=1.14.0 # Apache-2.0
|
||||
python-mistralclient>=3.3.0 # Apache-2.0
|
||||
pyzabbix>=0.7.4 # LGPL
|
||||
networkx<2.0,>=1.10 # BSD
|
||||
networkx<2.0,>=1.11 # BSD
|
||||
oslo.config>=5.2.0 # Apache-2.0
|
||||
oslo.context>=2.19.2 # Apache-2.0
|
||||
oslo.db>=4.27.0 # Apache-2.0
|
||||
oslo.messaging>=5.29.0 # Apache-2.0
|
||||
oslo.middleware>=3.31.0 # Apache-2.0
|
||||
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
|
||||
oslo.log>=3.36.0 # Apache-2.0
|
||||
oslo.policy>=1.30.0 # Apache-2.0
|
||||
oslo.service!=1.28.1,>=1.24.0 # Apache-2.0
|
||||
oslo.i18n>=3.15.3 # Apache-2.0
|
||||
pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD
|
||||
PasteDeploy>=1.5.0 # MIT
|
||||
Werkzeug>=0.9 # BSD License
|
||||
keystonemiddleware>=4.17.0 # Apache-2.0
|
||||
stevedore>=1.20.0 # Apache-2.0
|
||||
voluptuous>=0.8.9 # BSD License
|
||||
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
||||
sympy>=0.7.6 # BSD
|
||||
pysnmp>=4.2.3 # BSD
|
||||
PyJWT>=1.0.1 # MIT
|
||||
osprofiler>=1.4.0 # Apache-2.0
|
||||
oslo.context>=2.20.0 # Apache-2.0
|
||||
oslo.db>=4.35.0 # Apache-2.0
|
||||
oslo.messaging>=5.36.0 # Apache-2.0
|
||||
oslo.middleware>=3.35.0 # Apache-2.0
|
||||
oslo.serialization>=2.25.0 # Apache-2.0
|
||||
oslo.log>=3.37.0 # Apache-2.0
|
||||
oslo.policy>=1.34.0 # Apache-2.0
|
||||
oslo.i18n>=3.20.0 # Apache-2.0
|
||||
pecan>=1.2.1 # BSD
|
||||
PasteDeploy>=1.5.2 # MIT
|
||||
Werkzeug>=0.14.1 # BSD License
|
||||
keystonemiddleware>=4.21.0 # Apache-2.0
|
||||
stevedore>=1.28.0 # Apache-2.0
|
||||
voluptuous>=0.11.1 # BSD License
|
||||
SQLAlchemy>=1.2.5 # MIT
|
||||
sympy>=1.1.1 # BSD
|
||||
pysnmp>=4.4.4 # BSD
|
||||
PyJWT>=1.6.0 # MIT
|
||||
osprofiler>=2.0.0 # Apache-2.0
|
||||
keystoneauth1>=3.4.0 # Apache-2.0
|
||||
PyYAML>=3.12 # MIT
|
||||
requests>=2.14.2 # Apache-2.0
|
||||
WebOb>=1.7.1 # MIT
|
||||
eventlet!=0.18.3,!=0.20.1,<0.21.0,>=0.18.2 # MIT
|
||||
six>=1.10.0 # MIT
|
||||
debtcollector>=1.2.0 # Apache-2.0
|
||||
cotyledon>=1.3.0 # Apache-2.0
|
||||
requests>=2.18.4 # Apache-2.0
|
||||
WebOb>=1.7.4 # MIT
|
||||
eventlet!=0.20.1,>=0.20.0 # MIT
|
||||
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
|
||||
|
@ -3,36 +3,35 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
||||
python-dateutil>=2.5.3 # BSD
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
lxml!=3.7.0,>=3.4.1 # BSD
|
||||
networkx<2.0,>=1.10 # BSD
|
||||
PyMySQL>=0.7.6 # MIT License
|
||||
python-ceilometerclient>=2.5.0 # Apache-2.0
|
||||
python-cinderclient>=3.3.0 # Apache-2.0
|
||||
python-dateutil>=2.7.0 # BSD
|
||||
coverage>=4.5.1 # Apache-2.0
|
||||
lxml>=4.1.1 # BSD
|
||||
networkx<2.0,>=1.11 # BSD
|
||||
PyMySQL>=0.8.0 # MIT License
|
||||
python-ceilometerclient>=2.9.0 # Apache-2.0
|
||||
python-cinderclient>=3.5.0 # Apache-2.0
|
||||
python-neutronclient>=6.7.0 # Apache-2.0
|
||||
python-novaclient>=9.1.0 # Apache-2.0
|
||||
python-heatclient>=1.10.0 # Apache-2.0
|
||||
python-subunit>=1.0.0 # Apache-2.0/BSD
|
||||
python-novaclient>=10.1.0 # Apache-2.0
|
||||
python-heatclient>=1.14.0 # Apache-2.0
|
||||
python-subunit>=1.2.0 # Apache-2.0/BSD
|
||||
pyzabbix>=0.7.4 # LGPL
|
||||
oslo.db>=4.27.0 # Apache-2.0
|
||||
oslo.log>=3.36.0 # Apache-2.0
|
||||
oslotest>=3.2.0 # Apache-2.0
|
||||
oslo.service!=1.28.1,>=1.24.0 # Apache-2.0
|
||||
oslo.db>=4.35.0 # Apache-2.0
|
||||
oslo.log>=3.37.0 # Apache-2.0
|
||||
oslotest>=3.3.0 # Apache-2.0
|
||||
oslo.config>=5.2.0 # Apache-2.0
|
||||
oslo.messaging>=5.29.0 # Apache-2.0
|
||||
oslo.i18n>=3.15.3 # Apache-2.0
|
||||
oslo.policy>=1.30.0 # Apache-2.0
|
||||
pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD
|
||||
requests-mock>=1.2.0 # Apache-2.0
|
||||
testrepository>=0.0.18 # Apache-2.0/BSD
|
||||
testscenarios>=0.4 # Apache-2.0/BSD
|
||||
testtools>=2.2.0 # MIT
|
||||
stestr>=1.0.0 # Apache-2.0
|
||||
stevedore>=1.20.0 # Apache-2.0
|
||||
voluptuous>=0.8.9 # BSD License
|
||||
sympy>=0.7.6 # BSD
|
||||
reno>=2.5.0 # Apache-2.0
|
||||
pysnmp>=4.2.3 # BSD
|
||||
osprofiler>=1.4.0 # Apache-2.0
|
||||
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
||||
oslo.messaging>=5.36.0 # Apache-2.0
|
||||
oslo.i18n>=3.20.0 # Apache-2.0
|
||||
oslo.policy>=1.34.0 # Apache-2.0
|
||||
pecan>=1.2.1 # BSD
|
||||
requests-mock>=1.4.0 # Apache-2.0
|
||||
testrepository>=0.0.20 # Apache-2.0/BSD
|
||||
testscenarios>=0.5.0 # Apache-2.0/BSD
|
||||
testtools>=2.3.0 # MIT
|
||||
stestr>=2.0.0 # Apache-2.0
|
||||
stevedore>=1.28.0 # Apache-2.0
|
||||
voluptuous>=0.11.1 # BSD License
|
||||
sympy>=1.1.1 # BSD
|
||||
reno>=2.7.0 # Apache-2.0
|
||||
pysnmp>=4.4.4 # BSD
|
||||
osprofiler>=2.0.0 # Apache-2.0
|
||||
SQLAlchemy>=1.2.5 # MIT
|
||||
|
@ -12,13 +12,15 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import copy
|
||||
|
||||
import sys
|
||||
|
||||
import cotyledon
|
||||
from futurist import periodics
|
||||
from futurist import ThreadPoolExecutor
|
||||
from oslo_log import log
|
||||
import oslo_messaging
|
||||
from oslo_service import service as os_service
|
||||
from tools.load_generator.notification_info import * # noqa
|
||||
|
||||
from vitrage.messaging import get_transport
|
||||
from vitrage import service
|
||||
|
||||
@ -59,9 +61,9 @@ to avoid Vitrage consistency deleting the created resources.
|
||||
"""
|
||||
|
||||
|
||||
class StressNotificationsService(os_service.Service):
|
||||
def __init__(self, conf):
|
||||
super(StressNotificationsService, self).__init__()
|
||||
class StressNotificationsService(cotyledon.Service):
|
||||
def __init__(self, worker_id, conf):
|
||||
super(StressNotificationsService, self).__init__(worker_id)
|
||||
self.oslo_notifier = None
|
||||
topics = conf.datasources.notification_topics
|
||||
self.oslo_notifier = oslo_messaging.Notifier(
|
||||
@ -69,16 +71,19 @@ class StressNotificationsService(os_service.Service):
|
||||
driver='messagingv2',
|
||||
publisher_id='vitrage.stress',
|
||||
topics=topics)
|
||||
self.periodic = periodics.PeriodicWorker.create(
|
||||
[], executor_factory=lambda: ThreadPoolExecutor(max_workers=10))
|
||||
|
||||
def start(self):
|
||||
super(StressNotificationsService, self).start()
|
||||
self.tg.add_timer(RUN_EVERY_X_SECONDS, self.stress_notifications, )
|
||||
def run(self):
|
||||
LOG.info("StressNotificationsService - Started!")
|
||||
self.periodic.add(self.stress_notifications)
|
||||
self.periodic.start()
|
||||
|
||||
def stop(self, graceful=False):
|
||||
super(StressNotificationsService, self).stop(graceful)
|
||||
def terminate(self):
|
||||
self.periodic.stop()
|
||||
LOG.info("StressNotificationsService - Stopped!")
|
||||
|
||||
@periodics.periodic(spacing=RUN_EVERY_X_SECONDS)
|
||||
def stress_notifications(self):
|
||||
notifications = []
|
||||
for i in range(EXISTING_COMPUTES_NUM * VMS_PER_COMPUTE):
|
||||
@ -137,9 +142,9 @@ def create_vm(instance_num, compute_num):
|
||||
|
||||
def main():
|
||||
conf = service.prepare_service()
|
||||
launcher = os_service.ServiceLauncher(conf)
|
||||
launcher.launch_service(StressNotificationsService(conf))
|
||||
launcher.wait()
|
||||
sm = cotyledon.ServiceManager()
|
||||
sm.add(StressNotificationsService, args=(conf,))
|
||||
sm.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
from oslo_log import log
|
||||
import oslo_messaging
|
||||
from oslo_service import service as os_service
|
||||
|
||||
from vitrage.common.utils import spawn
|
||||
from vitrage.entity_graph import EVALUATOR_TOPIC
|
||||
@ -34,7 +33,7 @@ from vitrage import storage
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class VitrageApiHandlerService(os_service.Service):
|
||||
class VitrageApiHandlerService(object):
|
||||
|
||||
def __init__(self, conf, e_graph):
|
||||
super(VitrageApiHandlerService, self).__init__()
|
||||
@ -50,8 +49,6 @@ class VitrageApiHandlerService(os_service.Service):
|
||||
def _start(self):
|
||||
LOG.info("Vitrage Api Handler Service - Starting...")
|
||||
|
||||
super(VitrageApiHandlerService, self).start()
|
||||
|
||||
transport = messaging.get_rpc_transport(self.conf)
|
||||
rabbit_hosts = self.conf.oslo_messaging_rabbit.rabbit_hosts
|
||||
target = oslo_messaging.Target(topic=self.conf.rpc_topic,
|
||||
@ -70,10 +67,3 @@ class VitrageApiHandlerService(os_service.Service):
|
||||
server.start()
|
||||
|
||||
LOG.info("Vitrage Api Handler Service - Started!")
|
||||
|
||||
def stop(self, graceful=False):
|
||||
LOG.info("Vitrage Api Handler Service - Stopping...")
|
||||
|
||||
super(VitrageApiHandlerService, self).stop(graceful)
|
||||
|
||||
LOG.info("Vitrage Api Handler Service - Stopped!")
|
||||
|
@ -12,25 +12,41 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import cotyledon
|
||||
import sys
|
||||
|
||||
from oslo_service import service as os_service
|
||||
|
||||
from vitrage.cli import VITRAGE_TITLE
|
||||
from vitrage.common import utils
|
||||
from vitrage.datasources.listener_service import ListenerService
|
||||
from vitrage.datasources.rpc_service import CollectorRpcHandlerService
|
||||
from vitrage import service
|
||||
|
||||
|
||||
class CollectorService(cotyledon.Service):
|
||||
|
||||
def __init__(self, worker_id, conf):
|
||||
super(CollectorService, self).__init__(worker_id)
|
||||
self.csvc = CollectorRpcHandlerService(conf)
|
||||
utils.spawn(self.csvc.start)
|
||||
self.lsvc = ListenerService(conf)
|
||||
utils.spawn(self.lsvc.start)
|
||||
|
||||
def terminate(self):
|
||||
super(CollectorService, self).terminate()
|
||||
self.lsvc.stop()
|
||||
self.csvc.stop()
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
"""Starts all the datasources drivers services"""
|
||||
|
||||
print(VITRAGE_TITLE)
|
||||
conf = service.prepare_service()
|
||||
launcher = os_service.ServiceLauncher(conf)
|
||||
launcher.launch_service(ListenerService(conf))
|
||||
launcher.launch_service(CollectorRpcHandlerService(conf))
|
||||
launcher.wait()
|
||||
sm = cotyledon.ServiceManager()
|
||||
sm.add(CollectorService, args=(conf,))
|
||||
sm.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_service import service as os_service
|
||||
import cotyledon
|
||||
import sys
|
||||
|
||||
from vitrage.cli import VITRAGE_TITLE
|
||||
@ -23,9 +23,9 @@ from vitrage import service
|
||||
def main():
|
||||
print(VITRAGE_TITLE)
|
||||
conf = service.prepare_service()
|
||||
launcher = os_service.ServiceLauncher(conf)
|
||||
launcher.launch_service(MachineLearningService(conf))
|
||||
launcher.wait()
|
||||
sm = cotyledon.ServiceManager()
|
||||
sm.add(MachineLearningService, args=(conf,))
|
||||
sm.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -11,8 +11,7 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_service import service as os_service
|
||||
import cotyledon
|
||||
import sys
|
||||
|
||||
from vitrage.cli import VITRAGE_TITLE
|
||||
@ -23,9 +22,9 @@ from vitrage import service
|
||||
def main():
|
||||
print(VITRAGE_TITLE)
|
||||
conf = service.prepare_service()
|
||||
launcher = os_service.ServiceLauncher(conf)
|
||||
launcher.launch_service(VitrageNotifierService(conf))
|
||||
launcher.wait()
|
||||
sm = cotyledon.ServiceManager()
|
||||
sm.add(VitrageNotifierService, args=(conf,))
|
||||
sm.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
import sys
|
||||
|
||||
import cotyledon
|
||||
from oslo_log import log
|
||||
from oslo_service import service as os_service
|
||||
from vitrage.cli import VITRAGE_TITLE
|
||||
from vitrage.persistency.service import PersistorService
|
||||
from vitrage import service
|
||||
@ -28,9 +28,9 @@ def main():
|
||||
print(VITRAGE_TITLE)
|
||||
conf = service.prepare_service()
|
||||
db_connection = storage.get_connection_from_config(conf)
|
||||
launcher = os_service.ServiceLauncher(conf)
|
||||
launcher.launch_service(PersistorService(conf, db_connection))
|
||||
launcher.wait()
|
||||
sm = cotyledon.ServiceManager()
|
||||
sm.add(PersistorService, args=(conf, db_connection))
|
||||
sm.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
from oslo_service import service as os_service
|
||||
import cotyledon
|
||||
from vitrage.cli import VITRAGE_TITLE
|
||||
from vitrage import service
|
||||
from vitrage.snmp_parsing.service import SnmpParsingService
|
||||
@ -23,9 +23,9 @@ from vitrage.snmp_parsing.service import SnmpParsingService
|
||||
def main():
|
||||
print(VITRAGE_TITLE)
|
||||
conf = service.prepare_service()
|
||||
launcher = os_service.ServiceLauncher(conf)
|
||||
launcher.launch_service(SnmpParsingService(conf))
|
||||
launcher.wait()
|
||||
sm = cotyledon.ServiceManager()
|
||||
sm.add(SnmpParsingService, args=(conf,))
|
||||
sm.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -16,7 +16,6 @@ from collections import defaultdict
|
||||
|
||||
from oslo_log import log
|
||||
import oslo_messaging
|
||||
from oslo_service import service as os_service
|
||||
|
||||
from vitrage.datasources import utils
|
||||
from vitrage import messaging
|
||||
@ -25,7 +24,7 @@ from vitrage.messaging import VitrageNotifier
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class ListenerService(os_service.Service):
|
||||
class ListenerService(object):
|
||||
|
||||
def __init__(self, conf):
|
||||
super(ListenerService, self).__init__()
|
||||
@ -43,18 +42,16 @@ class ListenerService(os_service.Service):
|
||||
def start(self):
|
||||
LOG.info("Vitrage data source Listener Service - Starting...")
|
||||
|
||||
super(ListenerService, self).start()
|
||||
self.listener.start()
|
||||
|
||||
LOG.info("Vitrage data source Listener Service - Started!")
|
||||
|
||||
def stop(self, graceful=False):
|
||||
def stop(self):
|
||||
LOG.info("Vitrage data source Listener Service - Stopping...")
|
||||
|
||||
# Should it be here?
|
||||
# self.listener.stop()
|
||||
# self.listener.wait()
|
||||
super(ListenerService, self).stop(graceful)
|
||||
|
||||
LOG.info("Vitrage data source Listener Service - Stopped!")
|
||||
|
||||
|
@ -16,7 +16,6 @@ from concurrent import futures
|
||||
import time
|
||||
|
||||
from oslo_log import log
|
||||
from oslo_service import service as os_service
|
||||
|
||||
from vitrage.common.constants import DatasourceAction
|
||||
from vitrage.datasources import utils
|
||||
@ -26,7 +25,7 @@ from vitrage import rpc as vitrage_rpc
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class CollectorRpcHandlerService(os_service.Service):
|
||||
class CollectorRpcHandlerService(object):
|
||||
|
||||
def __init__(self, conf):
|
||||
super(CollectorRpcHandlerService, self).__init__()
|
||||
@ -39,13 +38,11 @@ class CollectorRpcHandlerService(os_service.Service):
|
||||
|
||||
def start(self):
|
||||
LOG.info("Collector Rpc Handler Service - Starting...")
|
||||
super(CollectorRpcHandlerService, self).start()
|
||||
self.server.start()
|
||||
LOG.info("Collector Rpc Handler Service - Started!")
|
||||
|
||||
def stop(self, graceful=False):
|
||||
def stop(self):
|
||||
LOG.info("Collector Rpc Handler Service - Stopping...")
|
||||
super(CollectorRpcHandlerService, self).stop(graceful)
|
||||
self.server.stop()
|
||||
LOG.info("Collector Rpc Handler Service - Stopped!")
|
||||
|
||||
|
@ -12,9 +12,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import cotyledon
|
||||
|
||||
from oslo_log import log
|
||||
import oslo_messaging as oslo_m
|
||||
from oslo_service import service as os_service
|
||||
from oslo_utils import importutils
|
||||
|
||||
from vitrage import messaging
|
||||
@ -23,10 +24,10 @@ from vitrage.opts import register_opts
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class MachineLearningService(os_service.Service):
|
||||
class MachineLearningService(cotyledon.Service):
|
||||
|
||||
def __init__(self, conf):
|
||||
super(MachineLearningService, self).__init__()
|
||||
def __init__(self, worker_id, conf):
|
||||
super(MachineLearningService, self).__init__(worker_id)
|
||||
self.conf = conf
|
||||
self.machine_learning_plugins = self.get_machine_learning_plugins(conf)
|
||||
transport = messaging.get_transport(conf)
|
||||
@ -36,20 +37,18 @@ class MachineLearningService(os_service.Service):
|
||||
transport, [target],
|
||||
[VitrageEventEndpoint(self.machine_learning_plugins)])
|
||||
|
||||
def start(self):
|
||||
def run(self):
|
||||
LOG.info("Vitrage Machine Learning Service - Starting...")
|
||||
|
||||
super(MachineLearningService, self).start()
|
||||
self.listener.start()
|
||||
|
||||
LOG.info("Vitrage Machine Learning Service - Started!")
|
||||
|
||||
def stop(self, graceful=False):
|
||||
def terminate(self):
|
||||
LOG.info("Vitrage Machine Learning Service - Stopping...")
|
||||
|
||||
self.listener.stop()
|
||||
self.listener.wait()
|
||||
super(MachineLearningService, self).stop(graceful)
|
||||
|
||||
LOG.info("Vitrage Machine Learning Service - Stopped!")
|
||||
|
||||
|
@ -11,10 +11,9 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import cotyledon
|
||||
from oslo_log import log
|
||||
import oslo_messaging
|
||||
from oslo_service import service as os_service
|
||||
from oslo_utils import importutils
|
||||
|
||||
from vitrage import messaging
|
||||
@ -23,32 +22,29 @@ from vitrage.opts import register_opts
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class VitrageNotifierService(os_service.Service):
|
||||
class VitrageNotifierService(cotyledon.Service):
|
||||
|
||||
def __init__(self, conf):
|
||||
super(VitrageNotifierService, self).__init__()
|
||||
def __init__(self, worker_id, conf):
|
||||
super(VitrageNotifierService, self).__init__(worker_id)
|
||||
self.conf = conf
|
||||
self.notifiers = self.get_notifier_plugins(conf)
|
||||
self._init_listeners(self.conf)
|
||||
|
||||
def start(self):
|
||||
def run(self):
|
||||
LOG.info("Vitrage Notifier Service - Starting...")
|
||||
|
||||
super(VitrageNotifierService, self).start()
|
||||
for listener in self.listeners:
|
||||
listener.start()
|
||||
|
||||
LOG.info("Vitrage Notifier Service - Started!")
|
||||
|
||||
def stop(self, graceful=False):
|
||||
def terminate(self):
|
||||
LOG.info("Vitrage Notifier Service - Stopping...")
|
||||
|
||||
for listener in self.listeners:
|
||||
listener.stop()
|
||||
listener.wait()
|
||||
|
||||
super(VitrageNotifierService, self).stop(graceful)
|
||||
|
||||
LOG.info("Vitrage Notifier Service - Stopped!")
|
||||
|
||||
@staticmethod
|
||||
|
@ -14,11 +14,11 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import cotyledon
|
||||
import dateutil.parser
|
||||
import oslo_messaging as oslo_m
|
||||
|
||||
from oslo_log import log
|
||||
from oslo_service import service as os_service
|
||||
from vitrage.common.constants import DatasourceProperties as DSProps
|
||||
from vitrage.common.constants import GraphAction
|
||||
from vitrage import messaging
|
||||
@ -28,9 +28,9 @@ from vitrage.storage.sqlalchemy import models
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class PersistorService(os_service.Service):
|
||||
def __init__(self, conf, db_connection):
|
||||
super(PersistorService, self).__init__()
|
||||
class PersistorService(cotyledon.Service):
|
||||
def __init__(self, worker_id, conf, db_connection):
|
||||
super(PersistorService, self).__init__(worker_id)
|
||||
self.conf = conf
|
||||
self.db_connection = db_connection
|
||||
transport = messaging.get_transport(conf)
|
||||
@ -40,20 +40,18 @@ class PersistorService(os_service.Service):
|
||||
transport, [target],
|
||||
[VitragePersistorEndpoint(self.db_connection)])
|
||||
|
||||
def start(self):
|
||||
def run(self):
|
||||
LOG.info("Vitrage Persistor Service - Starting...")
|
||||
|
||||
super(PersistorService, self).start()
|
||||
self.listener.start()
|
||||
|
||||
LOG.info("Vitrage Persistor Service - Started!")
|
||||
|
||||
def stop(self, graceful=False):
|
||||
def terminate(self):
|
||||
LOG.info("Vitrage Persistor Service - Stopping...")
|
||||
|
||||
self.listener.stop()
|
||||
self.listener.wait()
|
||||
super(PersistorService, self).stop(graceful)
|
||||
|
||||
LOG.info("Vitrage Persistor Service - Stopped!")
|
||||
|
||||
|
@ -14,9 +14,10 @@
|
||||
|
||||
from datetime import datetime
|
||||
import json
|
||||
|
||||
import cotyledon
|
||||
from oslo_log import log
|
||||
import oslo_messaging
|
||||
from oslo_service import service as os_service
|
||||
from oslo_utils import uuidutils
|
||||
from pyasn1.codec.ber import decoder
|
||||
from pysnmp.carrier.asyncore.dgram import udp
|
||||
@ -35,18 +36,17 @@ from vitrage.utils.file import load_yaml_file
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class SnmpParsingService(os_service.Service):
|
||||
class SnmpParsingService(cotyledon.Service):
|
||||
RUN_FOREVER = 1
|
||||
|
||||
def __init__(self, conf):
|
||||
super(SnmpParsingService, self).__init__()
|
||||
def __init__(self, worker_id, conf):
|
||||
super(SnmpParsingService, self).__init__(worker_id)
|
||||
self.conf = conf
|
||||
self.listening_port = conf.snmp_parsing.snmp_listening_port
|
||||
self._init_oslo_notifier()
|
||||
|
||||
def start(self):
|
||||
def run(self):
|
||||
LOG.info("Vitrage SNMP Parsing Service - Starting...")
|
||||
super(SnmpParsingService, self).start()
|
||||
|
||||
transport_dispatcher = AsyncoreDispatcher()
|
||||
transport_dispatcher.registerRecvCbFun(self.callback_func)
|
||||
@ -71,11 +71,8 @@ class SnmpParsingService(os_service.Service):
|
||||
transport_dispatcher.closeDispatcher()
|
||||
raise
|
||||
|
||||
def stop(self, graceful=False):
|
||||
def terminate(self):
|
||||
LOG.info("Vitrage SNMP Parsing Service - Stopping...")
|
||||
|
||||
super(SnmpParsingService, self).stop(graceful)
|
||||
|
||||
LOG.info("Vitrage SNMP Parsing Service - Stopped!")
|
||||
|
||||
# noinspection PyUnusedLocal
|
||||
|
@ -126,12 +126,12 @@ class TestSnmpParsing(base.BaseTest):
|
||||
cls.conf.register_opts(cls.OPTS, group='snmp_parsing')
|
||||
|
||||
def test_convert_binds_to_dict(self):
|
||||
parsing_service = SnmpParsingService(self.conf)
|
||||
parsing_service = SnmpParsingService(1, self.conf)
|
||||
dict_converted = parsing_service._convert_binds_to_dict(BINDS_REPORTED)
|
||||
self.assertEqual(dict_converted, DICT_EXPECTED)
|
||||
|
||||
def test_get_event_type(self):
|
||||
parsing_service = SnmpParsingService(self.conf)
|
||||
parsing_service = SnmpParsingService(1, self.conf)
|
||||
event_type = parsing_service._get_event_type(DICT_EXPECTED)
|
||||
self.assertEqual(event_type, 'vitrage.snmp.event')
|
||||
|
||||
@ -139,6 +139,6 @@ class TestSnmpParsing(base.BaseTest):
|
||||
converted_trap_diff_sys = copy.copy(DICT_EXPECTED)
|
||||
converted_trap_diff_sys.update(
|
||||
{u'1.3.6.1.4.1.3902.4101.1.3.1.12': u'Different System'})
|
||||
parsing_service = SnmpParsingService(self.conf)
|
||||
parsing_service = SnmpParsingService(1, self.conf)
|
||||
event_type = parsing_service._get_event_type(converted_trap_diff_sys)
|
||||
self.assertIsNone(event_type)
|
||||
|
Loading…
Reference in New Issue
Block a user