scaleway / scaleway-sdk-python

Integrate Scaleway with your Python applications
Apache License 2.0
24 stars 7 forks source link

list_servers_types throws exception #550

Closed FrPellissier closed 2 months ago

FrPellissier commented 3 months ago

In Python SDK v2.3.1, I have an error when calling list_servers_types(zone='fr-par-2', per_page=10)

The error is:

ListServersTypesResponse.init() missing 1 required positional argument: 'total_count'

Using Python 3.12

havetc commented 3 months ago

I got the same issue with list_servers_all() and list_servers(), also on python 3.12. It seems to happen when I have no server running. The api function unmarshal_ListServersResponse receives {'servers': []} Either scaleway should also return a total_count=0 in that case, or field = data.get("total_count", None) in unmarshal_ListServersResponse could be changed to field = data.get("total_count", 0) to have a default count at 0 if no value is provided