blob: 0becffe1826e61b030a75a172bb1e4d095b7644f [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
10
11zone_list = lists.zone_list
12zone_create = zones.zone_create
13zone_get_details = zones.zone_get_details
14zone_get_name_servers = zones.zone_get_name_servers
15zone_update = zones.zone_update
16zone_delete = zones.zone_delete
17
18
19__all__ = ('zone_list', 'zone_create', 'zone_delete', 'zone_update',
20 'zone_get_details', 'zone_get_name_servers',)
21
22
23def __virtual__():
24 """Only load designatev2 if requirements are available."""
25 if REQUIREMENTS_MET:
26 return 'designatev2'
27 else:
28 return False, ("The designatev2 execution module cannot be loaded: "
29 "os_client_config or keystoneauth are unavailable.")