Skip to content

Commit

Permalink
pylxd/models: Fill content_type on get
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Jul 5, 2024
1 parent 08107ed commit f014738
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pylxd/models/storage_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,9 @@ def get(cls, volume, name):
if response.json()["metadata"]["expires_at"] == "0001-01-01T00:00:00Z":
snapshot.expires_at = None

# This field is normally empty so derive it from its volume.
snapshot.content_type = volume.content_type

# Snapshot names are namespaced in LXD, as volume-name/snapshot-name.
# We hide that implementation detail.
snapshot.name = snapshot.name.split("/")[-1]
Expand Down

0 comments on commit f014738

Please sign in to comment.