Skip to content

Commit

Permalink
JSON to YAML transformations
Browse files Browse the repository at this point in the history
tendrl-bug-id: #70
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
  • Loading branch information
anmolbabu committed Jan 14, 2017
1 parent 299abd1 commit 2fa04ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tendrl/node_agent/alerts/alert_socket.py
Expand Up @@ -3,7 +3,6 @@
import gevent.greenlet
from gevent.server import StreamServer
from io import BlockingIOError
import json
import logging
from tendrl.commons.alert import AlertUtils
from tendrl.commons.config import ConfigNotFound
Expand All @@ -12,6 +11,7 @@
from tendrl.node_agent.alerts.base_alert_handler import NoHandlerException
import tendrl.node_agent.manager.utils as utils
import uuid
import yaml

config = TendrlConfig("node-agent", "/etc/tendrl/tendrl.conf")
LOG = logging.getLogger(__name__)
Expand All @@ -24,7 +24,7 @@ def read_socket(self, sock, address):
try:
data = sock.recv(RECEIVE_DATA_SIZE)
alert_utils = AlertUtils()
alert_json = json.loads(data)
alert_json = yaml.safe_load(data)
alert_json['alert_id'] = str(uuid.uuid4())
alert_json['significance'] = 'HIGH'
alert_json['node_id'] = utils.get_local_node_context()
Expand Down

0 comments on commit 2fa04ae

Please sign in to comment.