mirror of https://git.48k.eu/ogcli/
Print json instead of python dict in responses
r.json() decodes the responses json and passes it to json.loads() which will convert the content into a python dictionary. Print the literal JSON text so that output can be further manipulated by other tools like jq.master
parent
c80f27c98c
commit
565e798ef9
|
@ -13,7 +13,7 @@ class OgClient():
|
|||
@staticmethod
|
||||
def list_clients(rest):
|
||||
r = rest.get('/clients')
|
||||
print(r.json())
|
||||
print(r.text)
|
||||
|
||||
@staticmethod
|
||||
def list_client_hardware(rest, args):
|
||||
|
@ -27,7 +27,7 @@ class OgClient():
|
|||
|
||||
payload = {'client': parsed_args.client_ip}
|
||||
r = rest.get('/hardware', payload=payload)
|
||||
print(r.json())
|
||||
print(r.text)
|
||||
|
||||
@staticmethod
|
||||
def get_client_properties(rest, args):
|
||||
|
@ -40,4 +40,4 @@ class OgClient():
|
|||
|
||||
payload = {'client': parsed_args.client_ip}
|
||||
r = rest.get('/client/info', payload=payload)
|
||||
print(r.json())
|
||||
print(r.text)
|
||||
|
|
|
@ -13,7 +13,7 @@ class OgModes():
|
|||
@staticmethod
|
||||
def list_available_modes(rest):
|
||||
r = rest.get('/mode')
|
||||
print(r.json())
|
||||
print(r.text)
|
||||
|
||||
@staticmethod
|
||||
def set_modes(rest, args):
|
||||
|
|
|
@ -11,4 +11,4 @@ class OgScope():
|
|||
@staticmethod
|
||||
def list_scopes(rest):
|
||||
r = rest.get('/scopes')
|
||||
print(r.json())
|
||||
print(r.text)
|
||||
|
|
Loading…
Reference in New Issue