(name: str = '')
| 19 | |
| 20 | |
| 21 | def 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 | |
| 43 | def get_crypto_caller() -> CryptoCaller: |
no test coverage detected