$storeid must already be validated via the API/Config
parser

Signed-off-by: Fabian Grünbichler <[email protected]>
---
rebased v1

 PVE/API2/Ceph.pm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index dfcecbec..8ba59b1f 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -755,6 +755,18 @@ my $get_storages = sub {
     return $res;
 };
 
+my $remove_storage = sub {
+    my ($storeid) = @_;
+
+    PVE::API2::Storage::Config->delete({storage => $storeid});
+
+    my $pve_ceph_keydir = PVE::CephTools::get_config('pve_ceph_keydir');
+    my $keyring = "$pve_ceph_keydir/$storeid.keyring";
+    if (-f $keyring) {
+       unlink($keyring) or warn "removing keyring of storage failed: $!\n";
+    }
+};
+
 __PACKAGE__->register_method ({
     name => 'listmon',
     path => 'mon',
-- 
2.11.0


_______________________________________________
pve-devel mailing list
[email protected]
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to