osc-cli icon indicating copy to clipboard operation
osc-cli copied to clipboard

osc_sdk/sdk.py: Change api_connect return format

Open pitouche opened this issue 5 years ago • 0 comments

Hello, while using the function api_connect,

We where puzzled to have the answer printed to stdout, instead of a good python variable

Here is what we did to get something usable: diff --git a/osc_sdk/sdk.py b/osc_sdk/sdk.py index 16f4637..b81c769 100644 --- a/osc_sdk/sdk.py +++ b/osc_sdk/sdk.py @@ -538,7 +538,7 @@ def api_connect(service, call, profile='default', *args, **kwargs): handler = callsservice handler.make_request(call, *args, **kwargs) if handler.response:

  •    print(json.dumps(handler.response, indent=4))
    
  •    return handler.response
    

def main():

Is it possible to have this fix in the master branch ?

Thanks in advances.

pitouche avatar Jul 01 '20 13:07 pitouche