"""Carry out alarming requests via Aodh API."""
import json
-import logging as log
+import logging
+log = logging.getLogger(__name__)
from core.message_bus.producer import KafkaProducer
# Generate a valid response message, send via producer
try:
+ if alarm_status is True:
+ log.info("Alarm successfully created")
+
resp_message = self._response.generate_response(
'create_alarm_response', status=alarm_status,
alarm_id=alarm_id,
result = self._common._perform_request(
url, auth_token, req_type="delete")
if str(result.status_code) == "404":
+ log.info("Alarm doesn't exist: %s", result.status_code)
# If status code is 404 alarm did not exist
return False
else:
##
"""Aodh plugin for the OSM monitoring module."""
-import logging as log
+import logging
+
+logging.basicConfig(filename='aodh_MON.log', format='%(asctime)s %(message)s',
+ datefmt='%m/%d/%Y %I:%M:%S %p', filemode='a',
+ level=logging.INFO)
+log = logging.getLogger(__name__)
+
+
try:
import aodhclient
except ImportError:
import datetime
import json
-import logging as log
+import logging
+log = logging.getLogger(__name__)
+
import time
from core.message_bus.producer import KafkaProducer
##
"""Gnocchi plugin for the OSM monitoring module."""
-import logging as log
+import logging
+
+logging.basicConfig(filename='gnocchi_MON.log', datefmt='%m/%d/%Y %I:%M:%S %p',
+ format='%(asctime)s %(message)s', filemode='a',
+ level=logging.INFO)
+log = logging.getLogger(__name__)
try:
import gnocchiclient
##
"""Common methods for the OpenStack plugins."""
-import logging as log
+import logging
+log = logging.getLogger(__name__)
from keystoneclient.v3 import client
except Exception as e:
log.warn("Exception thrown on request", e)
+ if response is not None:
+ log.warn("Request resulted in %s code and %s response",
+ response.status_code, response.text)
return response
"""Generate valid responses to send back to the SO."""
import json
-import logging as log
+import logging
+log = logging.getLogger(__name__)
__author__ = "Helena McGough"
##
"""Configurations for the OpenStack plugins."""
-#from __future__ import unicode_literals
-
-import logging as log
+import logging
+log = logging.getLogger(__name__)
import os
from collections import namedtuple