]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/services/settings.py
1 # -*- coding: utf-8 -*-
2 from contextlib
import contextmanager
9 # pylint: disable=no-self-argument
10 def attribute_handler(name
):
12 :type name: str|dict[str, str]
13 :rtype: str|dict[str, str]
15 if isinstance(name
, dict):
17 _to_native(key
): value
18 for key
, value
in name
.items()
21 result
= _to_native(name
)
25 except AttributeError: # pragma: no cover - handling is too obvious
26 raise cherrypy
.NotFound(result
) # pragma: no cover - handling is too obvious
29 def _to_native(setting
):
30 return setting
.upper().replace('-', '_')