Added "indent=4, sort_keys=True" to all json.dumps() statements so the
resulting json output would be better formatted
This commit is contained in:
@@ -338,7 +338,7 @@ class SAML2client(object):
|
|||||||
if pp:
|
if pp:
|
||||||
pp.pprint(tsum)
|
pp.pprint(tsum)
|
||||||
else:
|
else:
|
||||||
print >> sys.stdout, json.dumps(tsum)
|
print >> sys.stdout, json.dumps(tsum, indent=4, sort_keys=True)
|
||||||
|
|
||||||
if tsum["status"] > 1 or self.args.debug or err:
|
if tsum["status"] > 1 or self.args.debug or err:
|
||||||
self.output_log(memoryhandler, streamhandler)
|
self.output_log(memoryhandler, streamhandler)
|
||||||
@@ -385,7 +385,7 @@ class SAML2client(object):
|
|||||||
|
|
||||||
lista.append(item)
|
lista.append(item)
|
||||||
|
|
||||||
print json.dumps(lista)
|
print json.dumps(lista, indent=4, sort_keys=True)
|
||||||
|
|
||||||
def _get_operation(self, operation):
|
def _get_operation(self, operation):
|
||||||
return self.operations.OPERATIONS[operation]
|
return self.operations.OPERATIONS[operation]
|
||||||
@@ -399,7 +399,7 @@ class SAML2client(object):
|
|||||||
mod = import_module("config")
|
mod = import_module("config")
|
||||||
_res = dict([(key, cnf["description"]) for key, cnf in
|
_res = dict([(key, cnf["description"]) for key, cnf in
|
||||||
mod.CONFIG.items()])
|
mod.CONFIG.items()])
|
||||||
print json.dumps(_res)
|
print json.dumps(_res, indent=4, sort_keys=True)
|
||||||
|
|
||||||
def verify_metadata(self):
|
def verify_metadata(self):
|
||||||
self.json_config = self.json_config_file()
|
self.json_config = self.json_config_file()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class FlowException(Exception):
|
|||||||
self.url = url
|
self.url = url
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return json.dumps(self.__dict__)
|
return json.dumps(self.__dict__, indent=4, sort_keys=True)
|
||||||
|
|
||||||
|
|
||||||
class RResponse():
|
class RResponse():
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class FlowException(Exception):
|
|||||||
self.url = url
|
self.url = url
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return json.dumps(self.__dict__)
|
return json.dumps(self.__dict__, indent=4, sort_keys=True)
|
||||||
|
|
||||||
|
|
||||||
class InteractionNeeded(Exception):
|
class InteractionNeeded(Exception):
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class FlowException(Exception):
|
|||||||
self.url = url
|
self.url = url
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return json.dumps(self.__dict__)
|
return json.dumps(self.__dict__, indent=4, sort_keys=True)
|
||||||
|
|
||||||
|
|
||||||
class DResponse():
|
class DResponse():
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ class Client(object):
|
|||||||
if pp:
|
if pp:
|
||||||
pp.pprint(tsum)
|
pp.pprint(tsum)
|
||||||
else:
|
else:
|
||||||
print >> sys.stdout, json.dumps(tsum)
|
print >> sys.stdout, json.dumps(tsum, indent=4, sort_keys=True)
|
||||||
|
|
||||||
if tsum["status"] > 1 or self.args.debug or err:
|
if tsum["status"] > 1 or self.args.debug or err:
|
||||||
self.output_log(memoryhandler, streamhandler)
|
self.output_log(memoryhandler, streamhandler)
|
||||||
@@ -262,7 +262,7 @@ class Client(object):
|
|||||||
for key, val in self.operations.OPERATIONS.items():
|
for key, val in self.operations.OPERATIONS.items():
|
||||||
res.append({"id": key, "name": val["name"]})
|
res.append({"id": key, "name": val["name"]})
|
||||||
|
|
||||||
print json.dumps(res)
|
print json.dumps(res, indent=4, sort_keys=True)
|
||||||
|
|
||||||
def verify_metadata(self):
|
def verify_metadata(self):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -74,4 +74,4 @@ info = {
|
|||||||
"name_format": NAME_FORMAT_URI
|
"name_format": NAME_FORMAT_URI
|
||||||
}
|
}
|
||||||
|
|
||||||
print json.dumps(info)
|
print json.dumps(info, indent=4, sort_keys=True)
|
||||||
@@ -64,4 +64,4 @@ info = {
|
|||||||
"name_format": NAME_FORMAT_URI
|
"name_format": NAME_FORMAT_URI
|
||||||
}
|
}
|
||||||
|
|
||||||
print json.dumps(info)
|
print json.dumps(info, indent=4, sort_keys=True)
|
||||||
@@ -40,4 +40,4 @@ info = {
|
|||||||
"userid": "roland"
|
"userid": "roland"
|
||||||
}
|
}
|
||||||
|
|
||||||
print json.dumps(info)
|
print json.dumps(info, indent=4, sort_keys=True)
|
||||||
Reference in New Issue
Block a user