# get mon. key
ret, keyring, err = self.mgr.check_mon_command({
'prefix': 'auth get',
- 'entity': 'mon.',
+ 'entity': self.get_auth_entity(name),
})
extra_config = '[mon.%s]\n' % name
# get mgr. key
ret, keyring, err = self.mgr.check_mon_command({
'prefix': 'auth get-or-create',
- 'entity': 'mgr.%s' % mgr_id,
+ 'entity': self.get_auth_entity(mgr_id),
'caps': ['mon', 'profile mgr',
'osd', 'allow *',
'mds', 'allow *'],
# get mgr. key
ret, keyring, err = self.mgr.check_mon_command({
'prefix': 'auth get-or-create',
- 'entity': 'mds.' + mds_id,
+ 'entity': self.get_auth_entity(mds_id),
'caps': ['mon', 'profile mds',
'osd', 'allow rw tag cephfs *=*',
'mds', 'allow'],
def get_keyring(self, rgw_id: str):
ret, keyring, err = self.mgr.check_mon_command({
'prefix': 'auth get-or-create',
- 'entity': f"{utils.name_to_config_section('rgw')}.{rgw_id}",
+ 'entity': self.get_auth_entity(rgw_id),
'caps': ['mon', 'allow *',
'mgr', 'allow rw',
'osd', 'allow rwx'],
ret, keyring, err = self.mgr.check_mon_command({
'prefix': 'auth get-or-create',
- 'entity': 'client.rbd-mirror.' + daemon_id,
+ 'entity': self.get_auth_entity(daemon_id),
'caps': ['mon', 'profile rbd-mirror',
'osd', 'profile rbd'],
})
ret, keyring, err = self.mgr.check_mon_command({
'prefix': 'auth get-or-create',
- 'entity': 'client.crash.' + host,
+ 'entity': self.get_auth_entity(daemon_id, host=host),
'caps': ['mon', 'profile crash',
'mgr', 'profile crash'],
})