From 89f5ee0d0425649de8a7e981f6268e488b22c037 Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 20 Apr 2022 16:24:42 +0100 Subject: [PATCH] Amend rbd-mirror capabilities Update rbd-mirror key caps to use the rbd-mirror-peer mon profile. This adds required config get/set permissions for the rbd-mirror daemon. Also add permission to use the service {dump,status} mon commands; these are not required by the rbd-mirror daemon but are needed by the charm to check pool mirror status. Change-Id: Ia5efa090f5b7fa23d7261da53592d6a527dcbfe1 Closes-Bug: 1879749 --- charms_ceph/utils.py | 5 ++++- unit_tests/test_utils.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/charms_ceph/utils.py b/charms_ceph/utils.py index 5e76e6b..e6adcb8 100644 --- a/charms_ceph/utils.py +++ b/charms_ceph/utils.py @@ -1167,7 +1167,10 @@ osd_upgrade_caps = collections.OrderedDict([ ]) rbd_mirror_caps = collections.OrderedDict([ - ('mon', ['profile rbd; allow r']), + ('mon', ['allow profile rbd-mirror-peer', + 'allow command "service dump"', + 'allow command "service status"' + ]), ('osd', ['profile rbd']), ('mgr', ['allow r']), ]) diff --git a/unit_tests/test_utils.py b/unit_tests/test_utils.py index 62df366..06d1ce1 100644 --- a/unit_tests/test_utils.py +++ b/unit_tests/test_utils.py @@ -1099,7 +1099,9 @@ class CephTestCase(unittest.TestCase): _get_named_key.assert_called_once_with( name='someid', caps=collections.OrderedDict([ - ('mon', ['profile rbd; allow r']), + ('mon', ['allow profile rbd-mirror-peer', + 'allow command "service dump"', + 'allow command "service status"']), ('osd', ['profile rbd']), ('mgr', ['allow r']), ])