mirror of
https://github.com/home-assistant/core.git
synced 2026-10-07 06:50:41 -04:00
Fix proxmox snapshot button sending name instead of snapname (#183042)
This commit is contained in:
@@ -177,7 +177,7 @@ VM_BUTTONS: tuple[ProxmoxVMButtonEntityDescription, ...] = (
|
||||
coordinator.proxmox.nodes(node)
|
||||
.qemu(vmid)
|
||||
.snapshot.post(
|
||||
name=f"homeassistant_snapshot_{dt_util.utcnow().strftime('%Y%m%d%H%M%S')}"
|
||||
snapname=f"homeassistant_snapshot_{dt_util.utcnow().strftime('%Y%m%d%H%M%S')}"
|
||||
)
|
||||
),
|
||||
permission=ProxmoxPermission.SNAPSHOT,
|
||||
@@ -217,7 +217,7 @@ CONTAINER_BUTTONS: tuple[ProxmoxContainerButtonEntityDescription, ...] = (
|
||||
coordinator.proxmox.nodes(node)
|
||||
.lxc(vmid)
|
||||
.snapshot.post(
|
||||
name=f"homeassistant_snapshot_{dt_util.utcnow().strftime('%Y%m%d%H%M%S')}"
|
||||
snapname=f"homeassistant_snapshot_{dt_util.utcnow().strftime('%Y%m%d%H%M%S')}"
|
||||
)
|
||||
),
|
||||
permission=ProxmoxPermission.SNAPSHOT,
|
||||
|
||||
@@ -176,9 +176,9 @@ async def test_snapshot_button(
|
||||
|
||||
# Proxmox validates the name as a `pve-configid` of at most 40 characters:
|
||||
# two or more, starting with a letter, then only [A-Za-z0-9_-]
|
||||
name = method_mock.call_args.kwargs["name"]
|
||||
assert len(name) <= 40
|
||||
assert re.fullmatch(r"[A-Za-z][A-Za-z0-9_-]+", name)
|
||||
snapname = method_mock.call_args.kwargs["snapname"]
|
||||
assert len(snapname) <= 40
|
||||
assert re.fullmatch(r"[A-Za-z][A-Za-z0-9_-]+", snapname)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
Reference in New Issue
Block a user