From 40312dca937ec2c6b29eeb191f8668e1cabe3b77 Mon Sep 17 00:00:00 2001 From: Volodymyr Samotiy Date: Mon, 21 Mar 2016 14:04:03 +0200 Subject: [PATCH] Fix JSON output, and make bv-bstctl executable from shell Change-Id: Ib54fee7529824a675e6f57cec4996fc06154f1d8 --- broadview_lib/tools/bv-bstctl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/broadview_lib/tools/bv-bstctl.py b/broadview_lib/tools/bv-bstctl.py index d2e376d..3d9ea93 100644 --- a/broadview_lib/tools/bv-bstctl.py +++ b/broadview_lib/tools/bv-bstctl.py @@ -1,3 +1,5 @@ +#!/usr/bin/python + # (C) Copyright Broadcom Corporation 2016 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +18,7 @@ from broadview_lib.config.bst import * from broadview_lib.config.broadviewconfig import BroadViewBSTSwitches import sys import unittest +import json class BSTConfigCommand(): def __init__(self): @@ -421,7 +424,7 @@ class BSTConfigCommand(): x.setASIC(asic) status = x.send() if status == 200: - ret = x.getJSON() + ret = json.dumps(x.getJSON()) print ret else: print "failure: %d" % (status) @@ -470,7 +473,7 @@ class BSTConfigCommand(): status, rep = x.send() if status == 200: - ret = x.getJSON() + ret = json.dumps(x.getJSON()) print ret else: print "failure: %d" % (status) @@ -516,7 +519,7 @@ class BSTConfigCommand(): status, rep = x.send() if status == 200: - ret = x.getJSON() + ret = json.dumps(x.getJSON()) print ret else: print "failure: %d" % (status)