Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix unmarshal_ServerType #872

Closed
wants to merge 2 commits into from
Closed

fix: fix unmarshal_ServerType #872

wants to merge 2 commits into from

Conversation

bprus
Copy link

@bprus bprus commented Feb 27, 2025

When trying to get available server types:

    client = Client.from_env()
    instance_api = InstanceV1API(client=client)
    instance_types = instance_api.list_servers_types().servers

It fails with:

Traceback (most recent call last):
  File ".../debug.py", line 7, in <module>
    _get_node_groups_scw(cluster_name="xxx")
  File ".../node.py", line 115, in _get_node_groups_scw
    instance_types = instance_api.list_servers_types().servers
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.venv/lib/python3.12/site-packages/scaleway/instance/v1/api.py", line 319, in list_servers_types
    return unmarshal_ListServersTypesResponse(res.json())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.venv/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 2216, in unmarshal_ListServersTypesResponse
    {key: unmarshal_ServerType(value) for key, value in field.items()}
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.venv/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 2198, in unmarshal_ServerType
    return ServerType(**args)
           ^^^^^^^^^^^^^^^^^^
TypeError: ServerType.__init__() missing 1 required positional argument: 'baremetal'

This PR tries to address this issue by setting baremetal to False if it is missing.

@github-actions github-actions bot added the instance Instance issues, bugs and feature requests label Feb 27, 2025
@remyleone
Copy link
Member

Hello, the file is generated, your PR will be overwritten :

# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.

We will investigate shortly

@bprus
Copy link
Author

bprus commented Feb 27, 2025

You're right, I missed the comment 🤦
If there's any way I can assist you, please let me know.

@Laure-di Laure-di closed this Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
instance Instance issues, bugs and feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants