MCPcopy Create free account
hub / github.com/ceph/ceph / choose_crypto_caller

Function choose_crypto_caller

src/python-common/ceph/cryptotools/select.py:21–40  ·  view source on GitHub ↗
(name: str = '')

Source from the content-addressed store, hash-verified

19
20
21def choose_crypto_caller(name: str = '') -> None:
22 _check_name(name)
23 if not name:
24 name = os.environ.get(_CC_ENV, '')
25 _check_name(name)
26 if not name:
27 name = _CC_REMOTE
28
29 if name == _CC_REMOTE:
30 import ceph.cryptotools.remote
31
32 _CACHE[_CC_KEY] = ceph.cryptotools.remote.ProcessCryptoCaller()
33 return
34 if name == _CC_INTERNAL:
35 import ceph.cryptotools.internal
36
37 _CACHE[_CC_KEY] = ceph.cryptotools.internal.InternalCryptoCaller()
38 return
39 # should be unreachable
40 raise RuntimeError('failed to setup a valid crypto caller')
41
42
43def get_crypto_caller() -> CryptoCaller:

Callers 4

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
get_crypto_callerFunction · 0.85

Calls 2

_check_nameFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected