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
296 stars 81 forks source link

204 response is not handled #91

Closed djangoliv closed 3 years ago

djangoliv commented 3 years ago

The requests:

result = client.put( '/cloud/project//kube//nodepool/', desiredNodes=2, maxNodes=4, minNodes=1, nodesToRemove=[], )

return 204 but the the parse of the result faied.

In client.py

        try:
            json_result = result.json()
        except ValueError as error:
            raise InvalidResponse("Failed to decode API response", error)

=> simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

which is normal since 204 is a No Content response .

Regards

djangoliv commented 3 years ago

This is a PR for fixing this bug: https://github.com/ovh/python-ovh/pull/92

Regards