Change-Id: Ia6ae411cd4c3ad074455c0cae32d198c89d0f52e
Signed-off-by: Gianpietro Lavado <glavado@whitestack.com>
import logging
import os
import sys
import logging
import os
import sys
logging.basicConfig(stream=sys.stdout,
format='%(asctime)s %(message)s',
logging.basicConfig(stream=sys.stdout,
format='%(asctime)s %(message)s',
for message in common_consumer:
log.info("Message arrived: %s", message)
try:
for message in common_consumer:
log.info("Message arrived: %s", message)
try:
- values = json.loads(message.value)
+ try:
+ values = json.loads(message.value)
+ except:
+ values = yaml.safe_load(message.value)
# Check the message topic
if message.topic == "metric_request":
# Check the vim desired by the message
# Check the message topic
if message.topic == "metric_request":
# Check the vim desired by the message
+pyyaml
\ No newline at end of file