This commit is contained in:
2026-07-22 15:01:36 +03:00
parent ae986fa9e6
commit 0d85368852
3 changed files with 13 additions and 8 deletions

View File

@@ -1637,12 +1637,17 @@ class decort_vm(DecortController):
f'disk {aparam_boot_disk_id} is not attached to '
f'Compute ID {self.comp_id}.'
)
else:
elif aparam_boot_disk_id is not None:
aparam_disk_ids = []
if aparam_disks['objects']:
aparam_disk_ids = [
disk['id'] for disk in aparam_disks['objects']
]
match aparam_disks['mode']:
case 'update':
if (
aparam_boot_disk_id not in comp_disk_ids
and aparam_boot_disk_id not in aparam_disks['ids']
and aparam_boot_disk_id not in aparam_disk_ids
):
check_errors = True
self.message(
@@ -1651,7 +1656,7 @@ class decort_vm(DecortController):
f'to Compute ID {self.comp_id}.'
)
case 'match':
if aparam_boot_disk_id not in aparam_disks['ids']:
if aparam_boot_disk_id not in aparam_disk_ids:
check_errors = True
self.message(
f'Check for parameter "boot.disk_id" failed: '
@@ -1659,7 +1664,7 @@ class decort_vm(DecortController):
f'disks.ids'
)
case 'detach' | 'delete':
if aparam_boot_disk_id in aparam_disks['ids']:
if aparam_boot_disk_id in aparam_disk_ids:
check_errors = True
self.message(
f'Check for parameter "boot.disk_id" failed: '