Skip to content

list_images: sbs_snapshot volume unmarshalling error #928

Open
@Timost

Description

@Timost

Hi,

First of all thank you for the sdk. 🙏

This is issue is very similar to: #636

It would seem that when the extra_volume is of type sbs_snapshots some data is missing from the API response.

This is the API response I get

{'arch': 'x86_64',
 'creation_date': '<redacted>'
 'default_bootscript': None,
 'extra_volumes': {'1': {'id': '<redacted>',
                         'name': '',
                         'size': 0,
                         'volume_type': 'sbs_snapshot'}},
 'from_server': '<redacted>',
 'id': '<redacted>',
 'modification_date': '<redacted>',
 'name': '<redacted>',
 'organization': '<redacted>',
 'project': '<redacted>',
 'public': False,
 'root_volume': {'id': '<redacted>',
                 'name': '<redacted>',
                 'size': 20000000000,
                 'volume_type': 'l_ssd'},
 'state': 'available',
 'tags': [],
 'zone': 'fr-par-1'}

It seems the Python code at https://github.com/scaleway/scaleway-sdk-python/blob/main/scaleway/scaleway/instance/v1/marshalling.py#L263 is expecting tags, project etc. for the extra_volumes field which are missing from the response.

The results is the following Exception:

lib/python3.11/site-packages/scaleway/instance/v1/marshalling.py", line 335, in unmarshal_Volume
    return Volume(**args)
           ^^^^^^^^^^^^^^
TypeError: Volume.__init__() missing 5 required positional arguments: 'organization', 'project', 'tags', 'state', and 'zone'

Maybe unmarshal_VolumeSummary should be used instead when the extra volume is of type sbs_snapshot ?

Could you please take a look ? This is preventing me from managing my backups properly. Thank you 🙏

Metadata

Metadata

Labels

bugSomething isn't workinginstanceInstance issues, bugs and feature requestspriority:highestBugs filled by customers, security issues

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions