]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/services/cephx.py
1 # -*- coding: utf-8 -*-
2 from __future__
import absolute_import
4 from .ceph_service
import CephService
9 def _entities_map(cls
, entity_type
=None):
10 auth_dump
= CephService
.send_command("mon", "auth list")
12 for auth_entry
in auth_dump
['auth_dump']:
13 entity
= auth_entry
['entity']
14 if not entity_type
or entity
.startswith('{}.'.format(entity_type
)):
15 entity_id
= entity
[entity
.find('.')+1:]
16 result
[entity_id
] = auth_entry
20 def _clients_map(cls
):
21 return cls
._entities
_map
("client")
24 def list_clients(cls
):
25 return [client
for client
in cls
._clients
_map
()]
28 def get_client_key(cls
, client_id
):
29 return cls
._clients
_map
()[client_id
]['key']