blob: e2379faab7a119574d016ab214fdd43e0e4c3aee [file] [log] [blame]
Oleksiy Petrenko777d7822018-11-06 13:32:44 +02001try:
2 import os_client_config # noqa
3 from keystoneauth1 import exceptions as ka_exceptions # noqa
4 REQUIREMENTS_MET = True
5except ImportError:
6 REQUIREMENTS_MET = False
7
8from designatev2 import lists
9from designatev2 import zones
sgarbuz0ebf5742018-11-21 17:39:45 +020010from designatev2 import services
Oleksiy Petrenko777d7822018-11-06 13:32:44 +020011
12zone_list = lists.zone_list
sgarbuz0ebf5742018-11-21 17:39:45 +020013status_list = lists.status_list
14service_wait = services.wait_for_services
Oleksiy Petrenko777d7822018-11-06 13:32:44 +020015zone_create = zones.zone_create
16zone_get_details = zones.zone_get_details
17zone_get_name_servers = zones.zone_get_name_servers
18zone_update = zones.zone_update
19zone_delete = zones.zone_delete
20
21
sgarbuz0ebf5742018-11-21 17:39:45 +020022__all__ = ('zone_list', 'status_list', 'service_wait', 'zone_create', 'zone_delete', 'zone_update',
Oleksiy Petrenko777d7822018-11-06 13:32:44 +020023 'zone_get_details', 'zone_get_name_servers',)
24
25
26def __virtual__():
27 """Only load designatev2 if requirements are available."""
28 if REQUIREMENTS_MET:
29 return 'designatev2'
30 else:
31 return False, ("The designatev2 execution module cannot be loaded: "
32 "os_client_config or keystoneauth are unavailable.")