X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fmessage_bus%2Fproducer.py;h=d4f80156855e4017fd9d4b083a835a9cc967abe3;hb=refs%2Fchanges%2F50%2F6050%2F3;hp=aad8b62bdecea0d4992a3531dca3d3def1fe3c30;hpb=1e75545fdded3a1eb0bb64bc3353c52bbf7f42a8;p=osm%2FMON.git diff --git a/osm_mon/core/message_bus/producer.py b/osm_mon/core/message_bus/producer.py index aad8b62..d4f8015 100755 --- a/osm_mon/core/message_bus/producer.py +++ b/osm_mon/core/message_bus/producer.py @@ -28,7 +28,7 @@ import logging import os -import jsmin +from jsmin import jsmin from kafka import KafkaProducer as kaf @@ -37,7 +37,8 @@ from kafka.errors import KafkaError __author__ = "Prithiv Mohan" __date__ = "06/Sep/2017" -json_path = os.path.abspath(os.pardir + "/MON/osm_mon/core/models/") +current_path = os.path.realpath(__file__) +json_path = os.path.abspath(os.path.join(current_path, '..', '..', 'models')) # TODO(): validate all of the request and response messages against the # json_schemas @@ -247,7 +248,7 @@ class KafkaProducer(object): # Internal to MON payload_metric_list_resp = jsmin( - open(os.path.join(json_path, 'list_metrics_resp.json')).read()) + open(os.path.join(json_path, 'list_metric_resp.json')).read()) self.publish(key, value=message,