[pve-devel] [PATCH manager 5/9] cli tools: correctly handle warnings status

Fabian Ebner f.ebner at proxmox.com
Wed May 12 14:32:54 CEST 2021


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/CLI/pveceph.pm | 2 +-
 PVE/CLI/pvenode.pm | 2 +-
 PVE/CLI/vzdump.pm  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
index 2745cc62..c02dc3fe 100755
--- a/PVE/CLI/pveceph.pm
+++ b/PVE/CLI/pveceph.pm
@@ -35,7 +35,7 @@ my $nodename = PVE::INotify::nodename();
 my $upid_exit = sub {
     my $upid = shift;
     my $status = PVE::Tools::upid_read_status($upid);
-    exit($status eq 'OK' ? 0 : -1);
+    exit(PVE::Tools::upid_status_is_error($status) ? -1 : 0);
 };
 
 sub setup_environment {
diff --git a/PVE/CLI/pvenode.pm b/PVE/CLI/pvenode.pm
index b05b3e15..acef6c3b 100644
--- a/PVE/CLI/pvenode.pm
+++ b/PVE/CLI/pvenode.pm
@@ -36,7 +36,7 @@ my $upid_exit = sub {
     my $upid = shift;
     my $status = PVE::Tools::upid_read_status($upid);
     print "Task $status\n";
-    exit($status eq 'OK' ? 0 : -1);
+    exit(PVE::Tools::upid_status_is_error($status) ? -1 : 0);
 };
 
 sub param_mapping {
diff --git a/PVE/CLI/vzdump.pm b/PVE/CLI/vzdump.pm
index fe5fd049..3f625574 100755
--- a/PVE/CLI/vzdump.pm
+++ b/PVE/CLI/vzdump.pm
@@ -19,7 +19,7 @@ our $cmddef = [ 'PVE::API2::VZDump', 'vzdump', 'vmid', undef,
 		    my $upid = shift;
 		    exit(0) if $upid eq 'OK';
 		    my $status = PVE::Tools::upid_read_status($upid);
-		    exit($status eq 'OK' ? 0 : -1);
+		    exit(PVE::Tools::upid_status_is_error($status) ? -1 : 0);
 		}];
 
 1;
-- 
2.20.1






More information about the pve-devel mailing list