Skip to content

Commit

Permalink
Introduce missing fields on StorageVolume and Image (#623)
Browse files Browse the repository at this point in the history
The integration tests are showing many warnings similar to `UserWarning:
Attempted to set unknown attribute "type" on instance of "Image"`, due
to PyLXD not recognizing some newish fields from a few API responses.
This introduces such fields to PyLXD.
  • Loading branch information
simondeziel authored Jan 9, 2025
2 parents 70f7cf4 + d3b740f commit bcc8f60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pylxd/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class Image(model.Model):
size = model.Attribute(readonly=True)
uploaded_at = model.Attribute(readonly=True)
update_source = model.Attribute(readonly=True)
type = model.Attribute(readonly=True)
project = model.Attribute(readonly=True)
profiles = model.Attribute(readonly=True)

@property
def api(self):
Expand Down
4 changes: 4 additions & 0 deletions pylxd/models/storage_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ class StorageVolume(model.Model):
config = model.Attribute()
used_by = model.Attribute(readonly=True)
location = model.Attribute(readonly=True)
# Date strings follow the ISO 8601 pattern
created_at = model.Attribute(readonly=True)
pool = model.Attribute(readonly=True)
project = model.Attribute(readonly=True)

snapshots = model.Manager()

Expand Down

0 comments on commit bcc8f60

Please sign in to comment.