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

CST-1092: fixed KeyError. #44

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

CST-1092: fixed KeyError. #44

wants to merge 1 commit into from

Conversation

Eddyredline
Copy link
Collaborator

Fixed KeyError: 'sourceImageId' in case of creating VM from deleted snapshot.

Signed-off-by: Aleksei Fedotov <[email protected]>
@@ -510,7 +510,7 @@ def _compare_disk(self, disk_id, disk_spec):
if str(disk_spec["size"]) != disk["size"]:
err.append("size")

if disk_spec.get("image_id") and disk_spec["image_id"] != disk["sourceImageId"]:
if disk_spec.get("image_id") and disk.get("sourceImageId") and disk_spec["image_id"] != disk["sourceImageId"]:
Copy link
Collaborator

@giggsoff giggsoff Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be if disk_spec.get("image_id") and (not disk.get("sourceImageId") or disk_spec["image_id"] != disk["sourceImageId"]):?

Looks like we should understand what is expected behavior if no sourceImageId defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants