[MON] Adds check for 'insecure' vim config param in Openstack plugin
[osm/MON.git] / osm_mon / plugins / CloudWatch / metrics.py
index f3a2144..1586359 100644 (file)
@@ -26,10 +26,8 @@ AWS-Plugin implements all the methods of MON to interact with AWS using the BOTO
 __author__ = "Wajeeha Hamid"
 __date__   = "18-Sept-2017"
 
-import sys
 import datetime
-import json
-import logging as log
+import logging
 
 try:
     import boto
@@ -40,7 +38,7 @@ try:
 except:
     exit("Boto not avialable. Try activating your virtualenv OR `pip install boto`")
 
-
+log = logging.getLogger(__name__)
 
 class Metrics():
 
@@ -71,7 +69,7 @@ class Metrics():
     
     def metricsData(self,cloudwatch_conn,data_info):
 
-       """Getting Metrics Stats for an Hour.The datapoints are
+        """Getting Metrics Stats for an Hour.The datapoints are
         received after every one minute.
         Time interval can be modified using Timedelta value"""
 
@@ -182,7 +180,7 @@ class Metrics():
                         metrics_info['resource_uuid'] = instance_id 
                         metrics_list.insert(itr,metrics_info)
                         itr += 1
-                    print metrics_list
+                    log.info(metrics_list)
                     return metrics_list
                 else: 
                     for alarm in alarms:
@@ -246,7 +244,7 @@ class Metrics():
             if metric_status == True:
                 check_resp['status'] = True
             else:
-               check_resp['status'] = False
+                check_resp['status'] = False
 
             return check_resp