import json
import logging
import sys
+import os
-sys.path.append("/root/MON")
+sys.path.insert(0, os.path.abspath('../'))
logging.basicConfig(filename='MON_plugins.log',
format='%(asctime)s %(message)s',
from kafka import KafkaConsumer
from kafka.errors import KafkaError
-from plugins.OpenStack.Aodh import alarming
-from plugins.OpenStack.common import Common
-from plugins.OpenStack.Gnocchi import metrics
+from osm_mon.plugins.OpenStack.Aodh import alarming
+from osm_mon.plugins.OpenStack.common import Common
+from osm_mon.plugins.OpenStack.Gnocchi import metrics
# Initialize servers
import logging
-from core.message_bus.producer import KafkaProducer
+from osm_mon.core.message_bus.producer import KafkaProducer
-from plugins.OpenStack.response import OpenStack_Response
-from plugins.OpenStack.settings import Config
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.response import OpenStack_Response
+from osm_mon.plugins.OpenStack.settings import Config
log = logging.getLogger(__name__)
import logging
+import os
+
import sys
import time
level=logging.INFO)
log = logging.getLogger(__name__)
-sys.path.append("/root/MON")
+sys.path.insert(0, os.path.abspath('../'))
-from core.message_bus.producer import KafkaProducer
+from osm_mon.core.message_bus.producer import KafkaProducer
-from plugins.OpenStack.Aodh.alarming import Alarming
-from plugins.OpenStack.common import Common
-from plugins.OpenStack.response import OpenStack_Response
-from plugins.OpenStack.settings import Config
+from osm_mon.plugins.OpenStack.Aodh.alarming import Alarming
+from osm_mon.plugins.OpenStack.common import Common
+from osm_mon.plugins.OpenStack.response import OpenStack_Response
+from osm_mon.plugins.OpenStack.settings import Config
class NotifierHandler(BaseHTTPRequestHandler):
import time
-from core.message_bus.producer import KafkaProducer
+from osm_mon.core.message_bus.producer import KafkaProducer
-from plugins.OpenStack.response import OpenStack_Response
-from plugins.OpenStack.settings import Config
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.response import OpenStack_Response
+from osm_mon.plugins.OpenStack.settings import Config
log = logging.getLogger(__name__)
from keystoneclient.v3 import client
-from plugins.OpenStack.settings import Config
+from osm_mon.plugins.OpenStack.settings import Config
import requests
import json
import logging
-log = logging.getLogger(__name__)
-__author__ = "Helena McGough"
+log = logging.getLogger(__name__)
schema_version = "1.0"
from collections import namedtuple
-from plugins.OpenStack.singleton import Singleton
+from osm_mon.plugins.OpenStack.singleton import Singleton
import six
from __future__ import unicode_literals
-__author__ = "Helena McGough"
-
class Singleton(object):
"""Simple singleton class."""
import mock
-from plugins.OpenStack.Aodh import alarming as alarm_req
-from plugins.OpenStack.common import Common
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.Aodh import alarming as alarm_req
+from osm_mon.plugins.OpenStack.common import Common
log = logging.getLogger(__name__)
import mock
-from plugins.OpenStack.Aodh import alarming as alarm_req
-from plugins.OpenStack.common import Common
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.Aodh import alarming as alarm_req
+from osm_mon.plugins.OpenStack.common import Common
log = logging.getLogger(__name__)
import mock
-from plugins.OpenStack.common import Common
-from plugins.OpenStack.settings import Config
+from osm_mon.plugins.OpenStack.common import Common
+from osm_mon.plugins.OpenStack.settings import Config
import requests
import mock
-from plugins.OpenStack.Gnocchi import metrics as metric_req
+from osm_mon.plugins.OpenStack.Gnocchi import metrics as metric_req
-from plugins.OpenStack.common import Common
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.common import Common
log = logging.getLogger(__name__)
import mock
-from plugins.OpenStack.Gnocchi import metrics as metric_req
+from osm_mon.plugins.OpenStack.Gnocchi import metrics as metric_req
-from plugins.OpenStack.common import Common
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.common import Common
log = logging.getLogger(__name__)
from BaseHTTPServer import BaseHTTPRequestHandler
-from core.message_bus.producer import KafkaProducer
-
import mock
-from plugins.OpenStack.Aodh.alarming import Alarming
-from plugins.OpenStack.common import Common
-from plugins.OpenStack.response import OpenStack_Response
-from plugins.OpenStack.settings import Config
+from osm_mon.core.message_bus.producer import KafkaProducer
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.Aodh.alarming import Alarming
+from osm_mon.plugins.OpenStack.common import Common
+from osm_mon.plugins.OpenStack.response import OpenStack_Response
+from osm_mon.plugins.OpenStack.settings import Config
# Mock data from post request
post_data = json.dumps({"severity": "critical",
import mock
-from plugins.OpenStack import response as resp
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack import response as resp
log = logging.getLogger(__name__)
import mock
-from plugins.OpenStack.settings import Config
-
-__author__ = "Helena McGough"
+from osm_mon.plugins.OpenStack.settings import Config
log = logging.getLogger(__name__)
lxc exec MON -- pip install -r /root/MON/requirements.txt
lxc exec MON -- python /root/MON/kafkad
lxc exec MON -- . /root/MON/scripts/kafka.sh
-lxc exec MON -- . /root/MON/plugins/vRealiseOps/vROPs_Webservice/install.sh
+lxc exec MON -- . /root/MON/osm_mon/plugins/vRealiseOps/vROPs_Webservice/install.sh
show-source = True
ignore = E123,E125,E241
builtins = _
-exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,core/*,devops_stages/*,plugins/CloudWatch/*, plugins/vRealiseOps/*,.rst
+exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,core/*,devops_stages/**.rst