2 Commits

Author SHA1 Message Date
9713b5cf2f 11.0.5 2026-08-11 13:40:04 +03:00
0d85368852 11.0.4 2026-07-22 15:01:36 +03:00
3 changed files with 29 additions and 14 deletions

View File

@@ -1,11 +1,11 @@
# Список изменений в версии 11.0.3 # Список изменений в версии 11.0.5
## Добавлено ## Добавлено
## Удалено ## Удалено
## Исправлено ## Исправлено
### Модуль decort_k8s ### Модуль decort_vm
| Идентификатор<br>задачи | Описание | | Идентификатор<br>задачи | Описание |
| --- | --- | | --- | --- |
| BANS-1208 | Модуль завершал работу ошибкой запроса к API при попытке модуля пересоздать группу воркеров. | | BANS-1386 | Модуль завершал работу ошибкой при передаче параметров `disks.objects.pci_slot_num_hex` и `disks.objects.bus_num_hex` в формате hex. |

View File

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

View File

@@ -43,7 +43,7 @@ class DecortController(object):
_api: sdk_types.API | None = None _api: sdk_types.API | None = None
_usermanager_whoami_result: None | dict = None _usermanager_whoami_result: None | dict = None
ANSIBLE_MODULES_VERSION = '11.0.3' ANSIBLE_MODULES_VERSION = '11.0.5'
COMPATIBLE_SDK_MINOR_VERSION = '1.4' COMPATIBLE_SDK_MINOR_VERSION = '1.4'
VM_RESIZE_NOT = 0 VM_RESIZE_NOT = 0
@@ -584,6 +584,12 @@ class DecortController(object):
return int(datetime(**datetime_args).timestamp()) return int(datetime(**datetime_args).timestamp())
@staticmethod
def _parse_hex(value: int | str) -> int:
if isinstance(value, int):
return value
return int(str(value).strip(), 16)
@staticmethod @staticmethod
def sec_to_dt_str(sec: float, str_format: str = '%Y-%m-%d_%H-%M-%S') -> str: def sec_to_dt_str(sec: float, str_format: str = '%Y-%m-%d_%H-%M-%S') -> str:
""" """
@@ -1150,12 +1156,16 @@ class DecortController(object):
if ( if (
( (
aparam_disk['pci_slot_num_hex'] is not None aparam_disk['pci_slot_num_hex'] is not None
and str(comp_disk['pci_slot']) and int(comp_disk['pci_slot'])
!= aparam_disk['pci_slot_num_hex'] != self._parse_hex(
aparam_disk['pci_slot_num_hex']
)
) or ( ) or (
aparam_disk['bus_num_hex'] is not None aparam_disk['bus_num_hex'] is not None
and str(comp_disk['bus_number']) and int(comp_disk['bus_number'])
!= aparam_disk['bus_num_hex'] != self._parse_hex(
aparam_disk['bus_num_hex']
)
) )
): ):
disks_to_detach.append(aparam_disk) disks_to_detach.append(aparam_disk)
@@ -1176,11 +1186,11 @@ class DecortController(object):
for disk in disks_to_attach: for disk in disks_to_attach:
pci_slot_num = disk['pci_slot_num_hex'] pci_slot_num = disk['pci_slot_num_hex']
if pci_slot_num is not None: if pci_slot_num is not None:
pci_slot_num = hex(int(pci_slot_num)) pci_slot_num = hex(self._parse_hex(pci_slot_num))
bus_num = disk['bus_num_hex'] bus_num = disk['bus_num_hex']
if bus_num is not None: if bus_num is not None:
bus_num = hex(int(bus_num)) bus_num = hex(self._parse_hex(bus_num))
api_params = { api_params = {
'computeId': comp_dict['id'], 'computeId': comp_dict['id'],