VM/CT Actions: Improve handling, move from boolean return to "success" or exception
Closed this issue · 2 comments
lsthompson commented
lsthompson commented
There is some code for this already, same under each action:
$response_message = json_encode($proxmox['data']['errors']);
return "Error performing action. " . $response_message;
However, a test shows that starting a running VM shows COMPLETED but Proxmox actually returned error.
So we need to change from if-fired-command-then-OK to if-command-returned-as-expected-then-OK.
if ($proxmox->post('/nodes/' . $first_node . '/' . $guest->vtype . '/' . $params['serviceid'] . '/status/start' , $pve_cmdparam))
return "success" ;
lsthompson commented
Pending refinement, this has been overhauled and works well - just about exception criteria but framework done.