[pve-devel] [PATCH V2 storage 04/10] Add remove cifs in API call.

Wolfgang Link w.link at proxmox.com
Fri Mar 16 10:22:53 CET 2018


---
 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 c36406c..0c41f91 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) {
-- 
2.11.0





More information about the pve-devel mailing list