]> git.proxmox.com Git - pmg-api.git/commit
fix #4815: pmgsh: fix calling the api paths directly
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 3 Jul 2023 08:28:19 +0000 (10:28 +0200)
committerStoiko Ivanov <s.ivanov@proxmox.com>
Mon, 3 Jul 2023 09:08:12 +0000 (11:08 +0200)
commit28579d81d15187710992f8e7fa8fd25da1458aba
tree235342efad81f9db9943a09fc5443168186a4d50
parent1828db45fbbc9103557cb0ac92cba6638a941e67
fix #4815: pmgsh: fix calling the api paths directly

if we get a command directly, we don't initialize the $rpcenv
variable anymore.

To fix it, make it a local variable of the pmg_command function.
We now make one extra '->get()' call per command (as opposed to
once per program), but that shouldn't cost us anything really.

Reported in the forum: https://forum.proxmox.com/threads/.130008/

Fixes: 1583283 ("pmgsh: initialize RPC/REST environment late")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [S.I: add bugreference, fixes trailer and shorten forum link]
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/bin/pmgsh