Skip to content

Commit

Permalink
[sub]fix(backend/image_transfert/encoder): update pydantic method (#763)
Browse files Browse the repository at this point in the history
* fix(backend/image_transfert/encoder): update pydantic method

Signed-off-by: Thibault Camalon <[email protected]>

* fix(backend/image_transfer/decoder): parse_raw -> model_validate_json

Signed-off-by: Thibault Camalon <[email protected]>

---------

Signed-off-by: Thibault Camalon <[email protected]>
  • Loading branch information
thbcmlowk authored and SdgJlbl committed Oct 20, 2023
1 parent aa80420 commit 8dd1459
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/image_transfer/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ def load_zip_images_in_registry(dxf_base: DXFBase, zip_file: ZipFile, strict: bo


def get_payload_descriptor(zip_file: ZipFile) -> PayloadDescriptor:
return PayloadDescriptor.parse_raw(zip_file.read("payload_descriptor.json").decode())
return PayloadDescriptor.model_validate_json(zip_file.read("payload_descriptor.json").decode())
2 changes: 1 addition & 1 deletion backend/image_transfer/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def create_zip_from_docker_images(
dest = payload_descriptor.manifests_paths[manifest.docker_image_name]
zip_file.writestr(dest, manifest.content)

zip_file.writestr("payload_descriptor.json", payload_descriptor.json(indent=4))
zip_file.writestr("payload_descriptor.json", payload_descriptor.model_dump_json(indent=4))


def make_payload(
Expand Down

0 comments on commit 8dd1459

Please sign in to comment.