]> git.proxmox.com Git - pve-storage.git/commitdiff
return error if volume does not exists
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 4 Sep 2013 08:17:47 +0000 (10:17 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 4 Sep 2013 08:17:47 +0000 (10:17 +0200)
PVE/API2/Storage/Content.pm

index ac784bd19f5507c4945ad58a86ed46c89386069a..e885b38afa2b1aad19a88a343ee24d9be56c6e3f 100644 (file)
@@ -233,13 +233,15 @@ __PACKAGE__->register_method ({
        $rpcenv->check_volume_access($authuser, $cfg, undef, $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?
        return {
            path => $path,
            size => $size,
             used => $used,
+           format => $format,
        };
     }});