Remove firmware parameter from clh platform runbook schema (#3480)

The 'firmware' parameter is now deprecated and is replaced by the
'kernel' parameter.

Co-authored-by: AASTHA RAWAT <aastharawat@microsoft.com>
This commit is contained in:
Aastha Rawat 2024-10-21 15:21:00 +05:30 коммит произвёл GitHub
Родитель 309f48d11c
Коммит 0dd26dfaa3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 7 добавлений и 20 удалений

Просмотреть файл

@ -62,22 +62,14 @@ class CloudHypervisorPlatform(BaseLibvirtPlatform):
assert isinstance(node_runbook, CloudHypervisorNodeSchema)
node_context = get_node_context(node)
if node_runbook.kernel:
if self.host_node.is_remote and not node_runbook.kernel.is_remote_path:
node_context.kernel_source_path = node_runbook.kernel.path
node_context.kernel_path = os.path.join(
self.vm_disks_dir, os.path.basename(node_runbook.kernel.path)
)
else:
node_context.kernel_path = node_runbook.kernel.path
assert node_runbook.kernel, "Kernel parameter is required for clh platform"
if self.host_node.is_remote and not node_runbook.kernel.is_remote_path:
node_context.kernel_source_path = node_runbook.kernel.path
node_context.kernel_path = os.path.join(
self.vm_disks_dir, os.path.basename(node_runbook.kernel.path)
)
else:
if self.host_node.is_remote:
node_context.kernel_source_path = node_runbook.firmware
node_context.kernel_path = os.path.join(
self.vm_disks_dir, os.path.basename(node_runbook.firmware)
)
else:
node_context.kernel_path = node_runbook.firmware
node_context.kernel_path = node_runbook.kernel.path
def _create_node(
self,

Просмотреть файл

@ -143,10 +143,5 @@ class KernelSchema:
@dataclass_json()
@dataclass
class CloudHypervisorNodeSchema(BaseLibvirtNodeSchema):
# DEPRECATED: use the 'kernel' field instead.
# Local path to the cloud-hypervisor firmware.
# Can be obtained from:
# https://github.com/cloud-hypervisor/rust-hypervisor-firmware
firmware: str = ""
# Local or remote path to the cloud-hypervisor kernel.
kernel: Optional[KernelSchema] = None