]> git.proxmox.com Git - pve-storage.git/commitdiff
added remove storage (exist) check
authorAlen Grizonic <a.grizonic@proxmox.com>
Wed, 19 Aug 2015 08:28:12 +0000 (10:28 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 19 Aug 2015 13:14:29 +0000 (15:14 +0200)
PVE/API2/Storage/Config.pm

index 27b3a550076425214a7bfa92cbcd002f58e2457e..425529954514f18ff00885342b51dcfd9c856b62 100755 (executable)
@@ -243,6 +243,9 @@ __PACKAGE__->register_method ({
 
                my $cfg = cfs_read_file('storage.cfg');
 
+               die "storage '$storeid' does not exist\n"
+                   if !($cfg->{ids}->{$storeid});
+
                die "can't remove storage - storage is used as base of another storage\n"
                    if PVE::Storage::storage_is_used($cfg, $storeid);