blob: 8c7418b08de68e837994c5195f68435c2c08d31d [file] [log] [blame]
Oleksiy Petrenko2652ac12018-04-16 17:40:13 +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 glancev2 import image
9from glancev2 import task
10
11image_create = image.image_create
12image_delete = image.image_delete
13image_deactivate = image.image_deactivate
14image_reactivate = image.image_reactivate
15image_list = image.image_list
16image_update = image.image_update
17image_download = image.image_data_download
18image_get_details = image.image_get_details
19task_list = task.task_list
20task_create = task.task_create
21task_show = task.task_show
22
23__all__ = (
24 'image_update', 'image_create', 'image_list', 'image_delete', 'task_show',
25 'image_download', 'task_create', 'task_list', 'image_get_details',
26 'image_deactivate', 'image_reactivate'
27)
28
29
30def __virtual__():
31 """Only load glanceng if requirements are available."""
32 if REQUIREMENTS_MET:
33 return 'glancev2'
34 else:
35 return False, ("The glanceng execution module cannot be loaded: "
36 "os_client_config or keystoneauth are unavailable.")