]> git.proxmox.com Git - pve-storage.git/commitdiff
Add remove cifs in API call.
authorWolfgang Link <w.link@proxmox.com>
Fri, 16 Mar 2018 09:22:53 +0000 (10:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 16 Mar 2018 11:05:02 +0000 (12:05 +0100)
PVE/API2/Storage/Config.pm

index a697e8dafd8062b449d941d711018b288df289c1..6f382c8b9af139e9bb6676e9f7bfeef0a66c684c 100755 (executable)
@@ -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) {