This repository has been archived on 2026-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Proxmox-VPS-Panel-secure/backend/app/proxmox_actions.py
T

15 lines
481 B
Python

from .proxmox_client import _client, _wait_task
from .config import settings
def delete_guest(guest_type: str, vmid: int) -> None:
"""Удаляет VM или LXC и ожидает завершения задачи Proxmox."""
client = _client()
node = settings.pve_node
if guest_type == "vm":
upid = client.nodes(node).qemu(vmid).delete()
else:
upid = client.nodes(node).lxc(vmid).delete()
if upid:
_wait_task(client, node, upid)