blob: 482f067b3627cd4941dac6e50e571f3cb7b23458 [file] [log] [blame]
Oleksiy Petrenko95664c02018-04-19 17:05:16 +03001try:
2 import os_client_config
3 from keystoneauth1 import exceptions as ka_exceptions
4 REQUIREMENTS_MET = True
5except ImportError:
6 REQUIREMENTS_MET = False
7
8from barbicanv1 import secrets
9from barbicanv1 import acl
10
11secret_list = secrets.secret_list
12secret_create = secrets.secret_create
13secret_delete = secrets.secret_delete
14secret_get_details = secrets.secret_get_details
15secret_payload_get = secrets.secret_payload_get
16secret_payload_set = secrets.secret_payload_set
17secret_acl_get = acl.secret_acl_get
18secret_acl_put = acl.secret_acl_put
19secret_acl_patch = acl.secret_acl_patch
20secret_acl_delete = acl.secret_acl_delete
21
22__all__ = (
23 'secret_list', 'secret_create', 'secret_delete', 'secret_get_details',
24 'secret_payload_get', 'secret_payload_set', 'secret_acl_delete',
25 'secret_acl_get', 'secret_acl_patch', 'secret_acl_put',
26)
27
28
29def __virtual__():
30 """Only load barbicanv1 if requirements are available."""
31 if REQUIREMENTS_MET:
32 return 'barbicanv1'
33 else:
34 return False, ("The barbicanv1 execution module cannot be loaded: "
35 "os_client_config or keystoneauth are unavailable.")