projects
/
osm
/
MON.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor bugs fix
[osm/MON.git]
/
osm_mon
/
core
/
message_bus
/
producer.py
diff --git
a/osm_mon/core/message_bus/producer.py
b/osm_mon/core/message_bus/producer.py
index
aad8b62
..
d4f8015
100755
(executable)
--- 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 os
-import jsmin
+
from jsmin
import jsmin
from kafka import KafkaProducer as kaf
from kafka import KafkaProducer as kaf
@@
-37,7
+37,8
@@
from kafka.errors import KafkaError
__author__ = "Prithiv Mohan"
__date__ = "06/Sep/2017"
__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
# 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(
# Internal to MON
payload_metric_list_resp = jsmin(
- open(os.path.join(json_path, 'list_metric
s
_resp.json')).read())
+ open(os.path.join(json_path, 'list_metric_resp.json')).read())
self.publish(key,
value=message,
self.publish(key,
value=message,