X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=plugins%2FCloudWatch%2Fmetrics.py;h=f3a21443b28be32fdf61c3218cfea80777f09103;hb=07f4f49ac725a07ba696b794fa26718a15d07082;hp=5faa659853f5bc4719829f873f5674c6682926b3;hpb=9f6a271648de423686a8de9882ea44020719e3fe;p=osm%2FMON.git diff --git a/plugins/CloudWatch/metrics.py b/plugins/CloudWatch/metrics.py index 5faa659..f3a2144 100644 --- a/plugins/CloudWatch/metrics.py +++ b/plugins/CloudWatch/metrics.py @@ -52,15 +52,17 @@ class Metrics(): supported=self.check_metric(metric_info['metric_name']) metric_resp = dict() + metric_resp['resource_uuid'] = metric_info['resource_uuid'] + if supported['status'] == True: metric_resp['status'] = True metric_resp['metric_uuid'] = 0 + log.debug("Metrics Configured Succesfully : %s" , metric_resp) else: metric_resp['status'] = False metric_resp['metric_uuid'] = None - - metric_resp['resource_uuid'] = metric_info['resource_uuid'] - log.debug("Metrics Configured Succesfully : %s" , metric_resp) + log.error("Metric name is not supported") + return metric_resp except Exception as e: @@ -100,6 +102,7 @@ class Metrics(): return False else: + log.error("Metric name is not supported") return False except Exception as e: @@ -113,15 +116,16 @@ class Metrics(): try: supported=self.check_metric(metric_info['metric_name']) update_resp = dict() + update_resp['resource_uuid'] = metric_info['resource_uuid'] if supported['status'] == True: update_resp['status'] = True update_resp['metric_uuid'] = 0 + log.debug("Metric Updated : %s", update_resp) else: update_resp['status'] = False update_resp['metric_uuid'] = None - - update_resp['resource_uuid'] = metric_info['resource_uuid'] - log.debug("Metric Updated : %s", update_resp) + log.error("Metric name is not supported") + return update_resp except Exception as e: @@ -148,6 +152,7 @@ class Metrics(): log.info("Metric Deletion Not supported in AWS : %s",del_resp) return del_resp else: + log.error("Metric name is not supported") return False except Exception as e: @@ -193,6 +198,7 @@ class Metrics(): return metrics_list log.debug("Metrics List : %s",metrics_list) else: + log.error("Metric name is not supported") return False except Exception as e: