Skip to content

Conversation

@mangelajo
Copy link
Contributor

Add image list method and switch to model_validate method in pydantic (the other one got deprectated)

I was getting this message:

client.py:198: PydanticDeprecatedSince20: The `parse_obj` method is deprecated;
  use `model_validate` instead. Deprecated in Pydantic V2.0 to be removed in V3.0.
  See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/
@mangelajo
Copy link
Contributor Author

I am testing with the real NanoKVM will remove draft once validated.

@puddly
Copy link
Owner

puddly commented Dec 21, 2025

Thanks! Should we bump the minimum pydantic version?

@mangelajo
Copy link
Contributor Author

ok, tested from the WIP jumpstarter driver, it looks good:

jumpstarter ⚡local ➤ j n image list
[12/21/2025 20:11:14] DEBUG    DEBUG:jumpstarter.exporter.session:GetReport()                                                    session.py:102
[12/21/2025 20:11:15] DEBUG    DEBUG:jumpstarter.exporter.session:DriverCall(uuid=9b05a06a-ba14-425d-9e91-64f28b464d80,          session.py:113
                               method=get_images)
                      DEBUG    DEBUG:nanokvm.client:Attempting authentication for user: admin                                     client.py:218
                      DEBUG    DEBUG:nanokvm.client:Making API request: POST /auth/login (username='admin'                        client.py:186
                               password='xxx')
[12/21/2025 20:11:16] DEBUG    DEBUG:nanokvm.client:Raw JSON response data: {'code': 0, 'msg': 'success', 'data': {'token':       client.py:196
                               'xxxxx'}}
                      DEBUG    DEBUG:nanokvm.client:Got API response: code=<ApiResponseCode.SUCCESS: 0> msg='success'             client.py:204
                               data=LoginRsp(token='xxxxx')
                      DEBUG    DEBUG:nanokvm.client:Making API request: GET /storage/image (None)                                 client.py:186
                      DEBUG    DEBUG:nanokvm.client:Raw JSON response data: {'code': 0, 'msg': 'success', 'data': {'files':       client.py:196
                               ['/data/alpine-standard-3.23.2-x86_64.iso', '/data/cs10-js.iso']}}
                      DEBUG    DEBUG:nanokvm.client:Got API response: code=<ApiResponseCode.SUCCESS: 0> msg='success'             client.py:204
                               data=GetImagesRsp(files=['/data/alpine-standard-3.23.2-x86_64.iso', '/data/cs10-js.iso'])
Available images:
  - /data/alpine-standard-3.23.2-x86_64.iso
  - /data/cs10-js.iso
jumpstarter ⚡local ➤

@mangelajo
Copy link
Contributor Author

Thanks! Should we bump the minimum pydantic version?

I think it's not necessary, this should work with 2 (the current one we pull) and 3 whenever they release it.

@puddly puddly merged commit 4b861d6 into puddly:dev Dec 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants