blob: e2379faab7a119574d016ab214fdd43e0e4c3aee [file] [log] [blame]
try:
import os_client_config # noqa
from keystoneauth1 import exceptions as ka_exceptions # noqa
REQUIREMENTS_MET = True
except ImportError:
REQUIREMENTS_MET = False
from designatev2 import lists
from designatev2 import zones
from designatev2 import services
zone_list = lists.zone_list
status_list = lists.status_list
service_wait = services.wait_for_services
zone_create = zones.zone_create
zone_get_details = zones.zone_get_details
zone_get_name_servers = zones.zone_get_name_servers
zone_update = zones.zone_update
zone_delete = zones.zone_delete
__all__ = ('zone_list', 'status_list', 'service_wait', 'zone_create', 'zone_delete', 'zone_update',
'zone_get_details', 'zone_get_name_servers',)
def __virtual__():
"""Only load designatev2 if requirements are available."""
if REQUIREMENTS_MET:
return 'designatev2'
else:
return False, ("The designatev2 execution module cannot be loaded: "
"os_client_config or keystoneauth are unavailable.")