]> git.proxmox.com Git - pve-container.git/commitdiff
lxc: resize: fix #2790 return message in case of disk already at size
authorAaron Lauterer <a.lauterer@proxmox.com>
Wed, 26 Aug 2020 08:51:26 +0000 (10:51 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 27 Aug 2020 07:21:26 +0000 (09:21 +0200)
Otherwise the API would return an error message because returning an
empty value is not defined in the API.

By dying we avoid confusions as the return will be an error and not a
successful call which should return a task ID.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
src/PVE/API2/LXC.pm

index 21899d0f406437204712f6a47f68b24eaac2da56..ced30939f49684cf6b28619abbbe41929614c777 100644 (file)
@@ -1674,7 +1674,7 @@ __PACKAGE__->register_method({
 
            die "unable to shrink disk size\n" if $newsize < $size;
 
-           return if $size == $newsize;
+           die "disk is already at specified size\n" if $size == $newsize;
 
            PVE::Cluster::log_msg('info', $authuser, "update CT $vmid: resize --disk $disk --size $sizestr");
            my $realcmd = sub {