blob: 7793d2117a36724ad35c84d559a4713e32b001ca [file] [log] [blame]
Oleg Bondarev9250e612018-09-24 18:59:40 +04001try:
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 octaviav2 import loadbalancers
9
10
11loadbalancer_list = loadbalancers.loadbalancer_list
12loadbalancer_get_details = loadbalancers.loadbalancer_get_details
13loadbalancer_update = loadbalancers.loadbalancer_update
14loadbalancer_delete = loadbalancers.loadbalancer_delete
15loadbalancer_create = loadbalancers.loadbalancer_create
16
17
18__all__ = (
19 'loadbalancer_get_details', 'loadbalancer_update', 'loadbalancer_delete',
20 'loadbalancer_list', 'loadbalancer_create',
21)
22
23
24def __virtual__():
25 """Only load neutronv2 if requirements are available."""
26 if REQUIREMENTS_MET:
27 return 'octaviav2'
28 else:
29 return False, ("The octaviav2 execution module cannot be loaded: "
30 "os_client_config or keystoneauth are unavailable.")