[pve-devel] [PATCH manager 07/20] ceph: mgr: delete auth key on destruction

Dominik Csapak d.csapak at proxmox.com
Tue Jun 4 14:47:46 CEST 2019


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/Ceph/Services.pm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/PVE/Ceph/Services.pm b/PVE/Ceph/Services.pm
index 0448c7d1..ec0aef14 100644
--- a/PVE/Ceph/Services.pm
+++ b/PVE/Ceph/Services.pm
@@ -327,7 +327,7 @@ sub create_mgr {
 }
 
 sub destroy_mgr {
-    my ($mgrid) = @_;
+    my ($mgrid, $rados) = @_;
 
     my $clustername = PVE::Ceph::Tools::get_config('ccname');
     my $mgrname = "mgr.$mgrid";
@@ -344,6 +344,13 @@ sub destroy_mgr {
     print "removing manager directory '$mgrdir'\n";
     File::Path::remove_tree($mgrdir);
 
+    print "removing authkeys for $mgrname\n";
+    if (!$rados) {
+	$rados = PVE::RADOS->new();
+    }
+
+    $rados->mon_command({ prefix => 'auth del', entity => "$mgrname" });
+
     broadcast_ceph_services();
 
     return undef;
-- 
2.11.0





More information about the pve-devel mailing list