blob: 16edda58eefdace515d4a617e78be06adaf2f49d [file] [log] [blame]
Mykyta Karpinfa53b302018-06-13 14:52: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 gnocchiv1 import archive_policy
9
10archive_policy_create = archive_policy.archive_policy_create
11archive_policy_delete = archive_policy.archive_policy_delete
12archive_policy_list = archive_policy.archive_policy_list
13archive_policy_update = archive_policy.archive_policy_update
14archive_policy_read = archive_policy.archive_policy_read
15
16archive_policy_rule_create = archive_policy.archive_policy_rule_create
17archive_policy_rule_delete = archive_policy.archive_policy_rule_delete
18archive_policy_rule_list = archive_policy.archive_policy_rule_list
19archive_policy_rule_read = archive_policy.archive_policy_rule_read
20
21__all__ = (
22 'archive_policy_update', 'archive_policy_create', 'archive_policy_list', 'archive_policy_delete',
23 'archive_policy_read', 'archive_policy_rule_create', 'archive_policy_rule_delete', 'archive_policy_rule_list',
24 'archive_policy_rule_read'
25)
26
27def __virtual__():
28 """Only load gnocchiv1 if requirements are available."""
29 if REQUIREMENTS_MET:
30 return 'gnocchiv1'
31 else:
32 return False, ("The gnocchiv1 execution module cannot be loaded: "
33 "os_client_config or keystoneauth are unavailable.")