return error if volume does not exists
This commit is contained in:
@ -233,13 +233,15 @@ __PACKAGE__->register_method ({
|
|||||||
$rpcenv->check_volume_access($authuser, $cfg, undef, $volid);
|
$rpcenv->check_volume_access($authuser, $cfg, undef, $volid);
|
||||||
|
|
||||||
my $path = PVE::Storage::path($cfg, $volid);
|
my $path = PVE::Storage::path($cfg, $volid);
|
||||||
my ($size, $format, $used) = PVE::Storage::file_size_info ($path);
|
my ($size, $format, $used, $parent) = PVE::Storage::file_size_info($path);
|
||||||
|
die "file_size_info on '$volid' failed\n" if !($format && $size);
|
||||||
|
|
||||||
# fixme: return more attributes?
|
# fixme: return more attributes?
|
||||||
return {
|
return {
|
||||||
path => $path,
|
path => $path,
|
||||||
size => $size,
|
size => $size,
|
||||||
used => $used,
|
used => $used,
|
||||||
|
format => $format,
|
||||||
};
|
};
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user