From ba7e9ba9c9fd7ac0470f0a7a65d0c25d20d1b655 Mon Sep 17 00:00:00 2001 From: Wolfgang Link Date: Fri, 16 Mar 2018 10:22:53 +0100 Subject: [PATCH] Add remove cifs in API call. --- PVE/API2/Storage/Config.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PVE/API2/Storage/Config.pm b/PVE/API2/Storage/Config.pm index a697e8d..6f382c8 100755 --- a/PVE/API2/Storage/Config.pm +++ b/PVE/API2/Storage/Config.pm @@ -295,6 +295,12 @@ __PACKAGE__->register_method ({ die "can't remove storage - storage is used as base of another storage\n" if PVE::Storage::storage_is_used($cfg, $storeid); + my $cred_file = '/etc/pve/priv/'.$storeid.'.cred'; + + unlink $cred_file + if ($cfg->{ids}->{$storeid}->{type} eq 'cifs') && + (-e $cred_file); + if ($scfg->{type} eq 'rbd' && !defined($scfg->{monhost})) { my $ceph_storage_keyring = "/etc/pve/priv/ceph/${storeid}.keyring"; if (-f $ceph_storage_keyring) {