kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 1 | try: |
| 2 | import os_client_config |
| 3 | REQUIREMENTS_MET = True |
| 4 | except ImportError: |
| 5 | REQUIREMENTS_MET = False |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 6 | |
Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame^] | 7 | from cinderv3 import lists |
| 8 | from cinderv3 import volumes |
| 9 | from cinderv3 import volume_types |
| 10 | from cinderv3 import volume_actions |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 11 | |
Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame^] | 12 | volume_list = lists.volume_list |
| 13 | volume_list_get_details = lists.volume_list_get_details |
| 14 | volume_create = volumes.volume_create |
| 15 | volume_get_details = volumes.volume_get_details |
| 16 | volume_update = volumes.volume_update |
| 17 | volume_delete = volumes.volume_delete |
| 18 | volume_metadata_create = volumes.volume_metadata_create |
| 19 | volume_metadata_show = volumes.volume_metadata_show |
| 20 | volume_metadata_update = volumes.volume_metadata_update |
| 21 | volume_metadata_show_key = volumes.volume_metadata_show_key |
| 22 | volume_metadata_delete = volumes.volume_metadata_delete |
| 23 | volume_metadata_update_key = volumes.volume_metadata_update_key |
| 24 | volume_type_list = lists.volume_type_list |
| 25 | volume_type_get_details = volume_types.volume_type_get_details |
| 26 | volume_type_create = volume_types.volume_type_create |
| 27 | volume_type_delete = volume_types.volume_type_delete |
| 28 | keys_volume_type_get = volume_types.keys_volume_type_get |
| 29 | keys_volume_type_set = volume_types.keys_volume_type_set |
| 30 | image_upload_volume = volume_actions.image_upload_volume |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 31 | |
Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame^] | 32 | __all__ = ('volume_list', 'volume_create', 'volume_delete', |
| 33 | 'volume_get_details', 'volume_list_get_details', 'volume_update', |
| 34 | 'volume_metadata_create', 'volume_metadata_delete', |
| 35 | 'volume_metadata_show', 'volume_metadata_show_key', |
| 36 | 'volume_metadata_update', 'volume_metadata_update_key', |
| 37 | 'volume_type_list', 'volume_type_get_details', |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 38 | 'volume_type_create', 'keys_volume_type_get', |
Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame^] | 39 | 'keys_volume_type_set', 'volume_type_delete', |
| 40 | 'image_upload_volume',) |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 41 | |
| 42 | |
| 43 | def __virtual__(): |
| 44 | if REQUIREMENTS_MET: |
| 45 | return 'cinderv3' |
| 46 | else: |
| 47 | return False, ("The cinderv3 execution module cannot be loaded: " |
| 48 | "os_client_config are unavailable.") |