[pve-devel] [PATCH manager 1/2] startall: refactor and fix error message

Dominik Csapak d.csapak at proxmox.com
Tue Jun 19 14:27:36 CEST 2018


for vms, it showed:
Starting VM 100 failed: status

instead of showing the actual status

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Nodes.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 2db5e1ec..a7d34fb1 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -1563,11 +1563,13 @@ __PACKAGE__->register_method ({
 				}
 			    }
 			} else {
+			    my $typeText = '';
 			    if ($d->{type} eq 'lxc') {
-				print STDERR "Starting CT $vmid failed: $status\n";
+				$typeText = ' CT';
 			    } elsif ($d->{type} eq 'qemu') {
-				print STDERR "Starting VM $vmid failed: status\n";
+				$typeText = ' VM';
 			    }
+			    print STDERR "Starting$typeText $vmid failed: $status\n";
 			}
 		    };
 		    warn $@ if $@;
-- 
2.11.0





More information about the pve-devel mailing list