]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/cephadm/utils.py
bump version to 15.2.4-pve1
[ceph.git] / ceph / src / pybind / mgr / cephadm / utils.py
CommitLineData
801d1391
TL
1import re
2
3from orchestrator import OrchestratorError
4
5def name_to_config_section(name):
6 """
7 Map from daemon names to ceph entity names (as seen in config)
8 """
9 daemon_type = name.split('.', 1)[0]
1911f103 10 if daemon_type in ['rgw', 'rbd-mirror', 'nfs', 'crash', 'iscsi']:
801d1391
TL
11 return 'client.' + name
12 elif daemon_type in ['mon', 'osd', 'mds', 'mgr', 'client']:
13 return name
14 else:
15 return 'mon'
e306af50
TL
16
17
18def name_to_auth_entity(name) -> str:
19 """
20 Map from daemon names to ceph entity names (as seen in config)
21 """
22 daemon_type = name.split('.', 1)[0]
23 if daemon_type in ['rgw', 'rbd-mirror', 'nfs', 'crash', 'iscsi']:
24 return 'client.' + name
25 elif daemon_type == 'mon':
26 return 'mon.'
27 elif daemon_type in ['osd', 'mds', 'mgr', 'client']:
28 return name
29 else:
30 raise OrchestratorError("unknown auth entity name")