From 4731d74c3003200f80898c2b0c45f3ee95745fc0 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Mon, 13 Mar 2023 13:10:12 +0100 Subject: [PATCH] Add checking errors in output from vsphere plugin servers, hosts and datastores commands --- .../protected/API/Pages/API/PluginVSphereListDatastores.php | 2 ++ gui/baculum/protected/API/Pages/API/PluginVSphereListHosts.php | 2 ++ .../protected/API/Pages/API/PluginVSphereListServers.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php b/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php index 9c0fd505a..def1538bc 100644 --- a/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php +++ b/gui/baculum/protected/API/Pages/API/PluginVSphereListDatastores.php @@ -116,6 +116,8 @@ class PluginVSphereListDatastores extends ConsoleOutputQueryPage { 'Wrong output from vSphere RAW datastore list: ' . implode(PHP_EOL, $ret->output) ); $ret->output = []; // don't provide errors to output, only in logs + } elseif ($this->isError($ret->output)) { + $ret->exitcode = PluginVSphereError::ERROR_EXECUTING_PLUGIN_QUERY_COMMAND; } return $ret; } diff --git a/gui/baculum/protected/API/Pages/API/PluginVSphereListHosts.php b/gui/baculum/protected/API/Pages/API/PluginVSphereListHosts.php index a57ee5028..8205e1553 100644 --- a/gui/baculum/protected/API/Pages/API/PluginVSphereListHosts.php +++ b/gui/baculum/protected/API/Pages/API/PluginVSphereListHosts.php @@ -116,6 +116,8 @@ class PluginVSphereListHosts extends ConsoleOutputQueryPage { 'Wrong output from vSphere RAW host list: ' . implode(PHP_EOL, $ret->output) ); $ret->output = []; // don't provide errors to output, only in logs + } elseif ($this->isError($ret->output)) { + $ret->exitcode = PluginVSphereError::ERROR_EXECUTING_PLUGIN_QUERY_COMMAND; } return $ret; } diff --git a/gui/baculum/protected/API/Pages/API/PluginVSphereListServers.php b/gui/baculum/protected/API/Pages/API/PluginVSphereListServers.php index f62398c46..9cc1f8676 100644 --- a/gui/baculum/protected/API/Pages/API/PluginVSphereListServers.php +++ b/gui/baculum/protected/API/Pages/API/PluginVSphereListServers.php @@ -111,6 +111,8 @@ class PluginVSphereListServers extends ConsoleOutputQueryPage { 'Wrong output from vSphere RAW server list: ' . implode(PHP_EOL, $ret->output) ); $ret->output = []; // don't provide errors to output, only in logs + } elseif ($this->isError($ret->output)) { + $ret->exitcode = PluginVSphereError::ERROR_EXECUTING_PLUGIN_QUERY_COMMAND; } return $ret; } -- 2.47.3