fix(images): unblock guest-exec in RHEL-family cloud images
The RHEL-family qemu-guest-agent package starts the agent with an allow-list that omits guest-exec, guest-exec-status and guest-file-* (FILTER_RPC_ARGS in /etc/sysconfig/qemu-ga; older packages spelled the same restriction as BLOCK_RPCS or BLACKLIST_RPC). The agent answered "The command guest-exec has been disabled for this instance", so running scripts in a VM, assigning extra IP addresses and growing the filesystem after a disk resize did not work on Rocky Linux, AlmaLinux, CentOS Stream and Fedora guests. - patch-cloud-images.sh: clear all three variants while building the mirror (UNBLOCK_RPC=0 opts out) and add an ONLY filter to rebuild only part of the catalog. Three `[ ... ] && ...` statements that aborted the script under set -e are now plain ifs -- the one before mirrors.json generation killed every run that passed BASE_URL - builtin.py: point the five RHEL-family amd64 entries at the rebuilt mirror release 2026-08-22 with their new checksums. Ubuntu and Debian images are unaffected and stay in the previous releases, so older panel versions keep working - client.py: annotate the Proxmox error with what to clear inside the guest, the raw message names neither the file nor the variable - WIKI, CHANGELOG: document the restriction and the unblock command
This commit is contained in:
@@ -123,3 +123,34 @@ def test_execute_script_sends_bytes_not_wide_chars():
|
||||
sent = agent.exec.post.call_args.kwargs["input-data"]
|
||||
assert all(ord(ch) < 256 for ch in sent), "в API уходят широкие символы"
|
||||
assert sent.encode("latin-1").decode("utf-8") == script
|
||||
|
||||
|
||||
def test_blocked_guest_exec_explains_how_to_fix():
|
||||
"""Образы RHEL-семейства запрещают guest-exec — ошибка должна это объяснять.
|
||||
|
||||
Proxmox отдаёт лишь "The command guest-exec has been disabled for this
|
||||
instance"; по такому тексту не догадаться, что чинить нужно
|
||||
/etc/sysconfig/qemu-ga внутри гостя.
|
||||
"""
|
||||
px = MagicMock()
|
||||
px.nodes.return_value.qemu.return_value.agent.exec.post.side_effect = RuntimeError(
|
||||
"500 Internal Server Error: QEMU guest agent command failed - "
|
||||
"The command guest-exec has been disabled for this instance"
|
||||
)
|
||||
|
||||
result = _client_with_mock(px).execute_script("prod", 103, "echo ok")
|
||||
|
||||
assert result["success"] is False
|
||||
assert "/etc/sysconfig/qemu-ga" in result["error"]
|
||||
assert "FILTER_RPC_ARGS" in result["error"]
|
||||
|
||||
|
||||
def test_unrelated_agent_error_is_not_annotated():
|
||||
px = MagicMock()
|
||||
px.nodes.return_value.qemu.return_value.agent.exec.post.side_effect = RuntimeError(
|
||||
"500 QEMU guest agent is not running"
|
||||
)
|
||||
|
||||
result = _client_with_mock(px).execute_script("prod", 104, "echo ok")
|
||||
|
||||
assert result["error"] == "500 QEMU guest agent is not running"
|
||||
|
||||
Reference in New Issue
Block a user