ovh / python-ovh

Thin wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing.
https://pypi.org/project/ovh/
Other
278 stars 76 forks source link

fix: Don't post data if no arguments were passed. #85

Closed amartinunowhy closed 2 years ago

amartinunowhy commented 4 years ago

There have been some changes in the production API that make any POST call without arguments to fail with the following error:

You provided an input body while none was expected

This is in particular the case in the cloud/project/{}/kube/{}/kubeconfig call.

The kwargs arguments to the upstream call is passed as data to raw_call(). A check for None is done to prevent adding a body. This condition is never true as in the case of no arguments, data is not None but contains an empty dict. In this case, loosy testing for falsiness is better.

DidelotK commented 3 years ago

Any news about this issues ?

sdiemer commented 3 years ago

Hello, I'm experiencing the same issue on /cloud/project/{}/user/{}/s3Credentials. @rbeuque74 Any news on a possible date for a fix ? Regards

sdiemer commented 2 years ago

Hello,

Any news on this issue ?

Regards

rbeuque74 commented 2 years ago

Hello @sdiemer , Sorry for the lag on my side. I changed a bit your proposal, looks good to me.

Thanks for your contribution ! :100: