Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix storage type fixtures #497

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pylxd/models/storage_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,13 @@ def all(cls, storage_pool):
for volume in response.json()["metadata"]:
(_type, name) = volume.split("/")[-2:]
# for each type, convert to the string that will work with GET
if _type == "containers":
if _type == "container":
_type = "container"
elif _type == "virtual-machines":
elif _type == "virtual-machine":
_type = "virtual-machine"
elif _type == "instances":
elif _type == "instance":
_type = "instance"
elif _type == "images":
elif _type == "image":
_type = "image"
else:
_type = "custom"
Expand Down
16 changes: 8 additions & 8 deletions pylxd/tests/mock_lxd.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,14 +889,14 @@ def snapshot_DELETE(request, context):
"json": {
"type": "sync",
"metadata": [
"/1.0/storage-pools/default/volumes/instances/c1",
"/1.0/storage-pools/default/volumes/instances/c2",
"/1.0/storage-pools/default/volumes/containers/c3",
"/1.0/storage-pools/default/volumes/containers/c4",
"/1.0/storage-pools/default/volumes/virtual-machines/vm1",
"/1.0/storage-pools/default/volumes/virtual-machines/vm2",
"/1.0/storage-pools/default/volumes/images/i1",
"/1.0/storage-pools/default/volumes/images/i2",
"/1.0/storage-pools/default/volumes/instance/c1",
"/1.0/storage-pools/default/volumes/instance/c2",
"/1.0/storage-pools/default/volumes/container/c3",
"/1.0/storage-pools/default/volumes/container/c4",
"/1.0/storage-pools/default/volumes/virtual-machine/vm1",
"/1.0/storage-pools/default/volumes/virtual-machine/vm2",
"/1.0/storage-pools/default/volumes/image/i1",
"/1.0/storage-pools/default/volumes/image/i2",
"/1.0/storage-pools/default/volumes/custom/cu1",
],
},
Expand Down