fix: deduplicate SSH keys on LXC/VM create; filter qemu templates in wizard
Some checks failed
Backend Tests / pytest (Python 3.12) (push) Has been cancelled

This commit is contained in:
markmorado
2026-05-08 13:06:23 +02:00
parent 5cb186e8d1
commit c317c4d81a
3 changed files with 29 additions and 2 deletions

View File

@@ -893,6 +893,15 @@ def _do_deploy_sync(task_id: int, deploy_data: VMDeployRequest,
ssh_keys = deploy_data.ssh_keys or ""
if user_ssh_key:
ssh_keys = f"{ssh_keys}\n{user_ssh_key}".strip()
# Deduplicate SSH keys while preserving order
_seen_ssh: set = set()
_uniq_ssh = []
for _k in ssh_keys.splitlines():
_k = _k.strip()
if _k and _k not in _seen_ssh:
_seen_ssh.add(_k)
_uniq_ssh.append(_k)
ssh_keys = "\n".join(_uniq_ssh)
config_success = client.configure_vm(
node=deploy_node,