[pve-devel] [PATCH 1/2] added remove storage (exist) check

Alen Grizonic a.grizonic at proxmox.com
Wed Aug 19 10:28:12 CEST 2015


---
 PVE/API2/Storage/Config.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/API2/Storage/Config.pm b/PVE/API2/Storage/Config.pm
index 27b3a55..4255299 100755
--- a/PVE/API2/Storage/Config.pm
+++ b/PVE/API2/Storage/Config.pm
@@ -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);
 
-- 
2.1.4





More information about the pve-devel mailing list