Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: charlie4284 <[email protected]>
  • Loading branch information
yanksyoon committed Apr 23, 2024
1 parent 10635cb commit 3847fcc
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions pylxd/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def all(cls, client):
return images

@classmethod
def create(cls, client, image_data, metadata=None, public=False, wait=True, vm=False):
def create(
cls, client, image_data, metadata=None, public=False, wait=True, vm=False
):
"""Create an image.
If metadata is provided, a multipart form data request is formed to
Expand Down Expand Up @@ -130,10 +132,16 @@ def create(cls, client, image_data, metadata=None, public=False, wait=True, vm=F
rootfs=("rootfs", image_data, "application/octet-stream"),
)
else:
files = collections.OrderedDict({
"metadata":("metadata", metadata, "application/octet-stream"),
"rootfs.img":("rootfs.img", image_data, "application/octet-stream"),
})
files = collections.OrderedDict(
{
"metadata": ("metadata", metadata, "application/octet-stream"),
"rootfs.img": (
"rootfs.img",
image_data,
"application/octet-stream",
),
}
)
data = MultipartEncoder(files)
headers.update({"Content-Type": data.content_type})
else:
Expand Down

0 comments on commit 3847fcc

Please sign in to comment.