2 Commits

Author SHA1 Message Date
b2cb33e9a8 12.0.3 2026-08-11 11:52:11 +03:00
d5ce634491 12.0.2 2026-07-22 13:27:40 +03:00
3 changed files with 29 additions and 14 deletions

View File

@@ -1,11 +1,11 @@
# Список изменений в версии 12.0.1 # Список изменений в версии 12.0.3
## Добавлено ## Добавлено
## Удалено ## Удалено
## Исправлено ## Исправлено
### Модуль decort_sdn_logical_port ### Модуль decort_vm
| Идентификатор<br>задачи | Описание | | Идентификатор<br>задачи | Описание |
| --- | --- | | --- | --- |
| BANS-1157 | Модуль не совершал удаление адресов при переданном параметре `no_addresses: true`. | | BANS-1377 | Модуль завершал работу ошибкой при передаче параметров `disks.objects.pci_slot_num_hex` и `disks.objects.bus_num_hex` в формате hex. |

View File

@@ -1652,12 +1652,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(
@@ -1666,7 +1671,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: '
@@ -1674,7 +1679,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

@@ -49,7 +49,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 = '12.0.0' ANSIBLE_MODULES_VERSION = '12.0.3'
COMPATIBLE_SDK_MINOR_VERSION = '1.5' COMPATIBLE_SDK_MINOR_VERSION = '1.5'
VM_RESIZE_NOT = 0 VM_RESIZE_NOT = 0
@@ -619,6 +619,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:
""" """
@@ -1144,12 +1150,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)
@@ -1170,11 +1180,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'],