esxi: use listvms.py's stderr as error message
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -140,10 +140,18 @@ sub get_manifest : prototype($$$;$) {
|
|||||||
my $user = $scfg->{username};
|
my $user = $scfg->{username};
|
||||||
my $pwfile = esxi_cred_file_name($storeid);
|
my $pwfile = esxi_cred_file_name($storeid);
|
||||||
my $json = '';
|
my $json = '';
|
||||||
run_command(
|
my $errmsg = '';
|
||||||
[$ESXI_LIST_VMS, @extra_params, $host, $user, $pwfile],
|
eval {
|
||||||
outfunc => sub { $json .= $_[0] . "\n" },
|
run_command(
|
||||||
);
|
[$ESXI_LIST_VMS, @extra_params, $host, $user, $pwfile],
|
||||||
|
outfunc => sub { $json .= $_[0] . "\n" },
|
||||||
|
errfunc => sub { $errmsg .= $_[0] . "\n" },
|
||||||
|
);
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
# propagate listvms error output if any, otherwise use the error from run_command
|
||||||
|
die $errmsg || $@;
|
||||||
|
}
|
||||||
|
|
||||||
my $result = PVE::Storage::ESXiPlugin::Manifest->new($json);
|
my $result = PVE::Storage::ESXiPlugin::Manifest->new($json);
|
||||||
mkpath($rundir);
|
mkpath($rundir);
|
||||||
|
|||||||
Reference in New Issue
Block a user