Fix JSON output, and make bv-bstctl executable from shell

Change-Id: Ib54fee7529824a675e6f57cec4996fc06154f1d8
This commit is contained in:
Volodymyr Samotiy 2016-03-21 14:04:03 +02:00
parent 4a99302671
commit 40312dca93

View File

@ -1,3 +1,5 @@
#!/usr/bin/python
# (C) Copyright Broadcom Corporation 2016 # (C) Copyright Broadcom Corporation 2016
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # 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 from broadview_lib.config.broadviewconfig import BroadViewBSTSwitches
import sys import sys
import unittest import unittest
import json
class BSTConfigCommand(): class BSTConfigCommand():
def __init__(self): def __init__(self):
@ -421,7 +424,7 @@ class BSTConfigCommand():
x.setASIC(asic) x.setASIC(asic)
status = x.send() status = x.send()
if status == 200: if status == 200:
ret = x.getJSON() ret = json.dumps(x.getJSON())
print ret print ret
else: else:
print "failure: %d" % (status) print "failure: %d" % (status)
@ -470,7 +473,7 @@ class BSTConfigCommand():
status, rep = x.send() status, rep = x.send()
if status == 200: if status == 200:
ret = x.getJSON() ret = json.dumps(x.getJSON())
print ret print ret
else: else:
print "failure: %d" % (status) print "failure: %d" % (status)
@ -516,7 +519,7 @@ class BSTConfigCommand():
status, rep = x.send() status, rep = x.send()
if status == 200: if status == 200:
ret = x.getJSON() ret = json.dumps(x.getJSON())
print ret print ret
else: else:
print "failure: %d" % (status) print "failure: %d" % (status)