3 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
ae986fa9e6 11.0.3 2026-05-25 14:58:44 +07:00
3 changed files with 33 additions and 15 deletions

View File

@@ -1,11 +1,11 @@
# Список изменений в версии 11.0.2
# Список изменений в версии 11.0.5
## Добавлено
## Удалено
## Исправлено
### Модуль decort_k8s
### Модуль decort_vm
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BANS-1180 | Модуль завершал работу ошибкой Python при создании кластера с несколькими группами воркеров. |
| 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'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: '

View File

@@ -43,7 +43,7 @@ class DecortController(object):
_api: sdk_types.API | None = None
_usermanager_whoami_result: None | dict = None
ANSIBLE_MODULES_VERSION = '11.0.2'
ANSIBLE_MODULES_VERSION = '11.0.5'
COMPATIBLE_SDK_MINOR_VERSION = '1.4'
VM_RESIZE_NOT = 0
@@ -584,6 +584,12 @@ class DecortController(object):
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
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 (
(
aparam_disk['pci_slot_num_hex'] is not None
and str(comp_disk['pci_slot'])
!= aparam_disk['pci_slot_num_hex']
and int(comp_disk['pci_slot'])
!= self._parse_hex(
aparam_disk['pci_slot_num_hex']
)
) or (
aparam_disk['bus_num_hex'] is not None
and str(comp_disk['bus_number'])
!= aparam_disk['bus_num_hex']
and int(comp_disk['bus_number'])
!= self._parse_hex(
aparam_disk['bus_num_hex']
)
)
):
disks_to_detach.append(aparam_disk)
@@ -1176,11 +1186,11 @@ class DecortController(object):
for disk in disks_to_attach:
pci_slot_num = disk['pci_slot_num_hex']
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']
if bus_num is not None:
bus_num = hex(int(bus_num))
bus_num = hex(self._parse_hex(bus_num))
api_params = {
'computeId': comp_dict['id'],
@@ -5651,7 +5661,10 @@ class DecortController(object):
'workerDisk': wg_to_create['disk'],
'workerSepId': wg_to_create['sep_id'],
'workerSepPool': wg_to_create['pool'],
'labels': wg_to_create['labels'],
'labels': [
label for label in (wg_to_create['labels'] or [])
if 'workersGroupName' not in label
],
'taints': wg_to_create['taints'],
'annotations': wg_to_create['annotations'],
'userData': json.dumps(wg_to_create['ci_user_data']),