From 402df80b12f27e1fe8dfd33064cda79027bcf910 Mon Sep 17 00:00:00 2001 From: Alen Grizonic Date: Wed, 19 Aug 2015 10:28:12 +0200 Subject: [PATCH] added remove storage (exist) check --- 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.39.2