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 |
Oleksandr Shyshko | 04099ea | 2018-11-22 16:02:52 +0200 | [diff] [blame] | 11 | from cinderv3 import services |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 12 | |
Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame] | 13 | volume_list = lists.volume_list |
| 14 | volume_list_get_details = lists.volume_list_get_details |
| 15 | volume_create = volumes.volume_create |
| 16 | volume_get_details = volumes.volume_get_details |
| 17 | volume_update = volumes.volume_update |
| 18 | volume_delete = volumes.volume_delete |
| 19 | volume_metadata_create = volumes.volume_metadata_create |
| 20 | volume_metadata_show = volumes.volume_metadata_show |
| 21 | volume_metadata_update = volumes.volume_metadata_update |
| 22 | volume_metadata_show_key = volumes.volume_metadata_show_key |
| 23 | volume_metadata_delete = volumes.volume_metadata_delete |
| 24 | volume_metadata_update_key = volumes.volume_metadata_update_key |
| 25 | volume_type_list = lists.volume_type_list |
| 26 | volume_type_get_details = volume_types.volume_type_get_details |
| 27 | volume_type_create = volume_types.volume_type_create |
| 28 | volume_type_delete = volume_types.volume_type_delete |
| 29 | keys_volume_type_get = volume_types.keys_volume_type_get |
| 30 | keys_volume_type_set = volume_types.keys_volume_type_set |
| 31 | image_upload_volume = volume_actions.image_upload_volume |
Oleksandr Shyshko | 04099ea | 2018-11-22 16:02:52 +0200 | [diff] [blame] | 32 | service_list = lists.service_list |
| 33 | service_update = services.service_update |
| 34 | service_wait = services.wait_for_service |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 35 | |
Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame] | 36 | __all__ = ('volume_list', 'volume_create', 'volume_delete', |
| 37 | 'volume_get_details', 'volume_list_get_details', 'volume_update', |
| 38 | 'volume_metadata_create', 'volume_metadata_delete', |
| 39 | 'volume_metadata_show', 'volume_metadata_show_key', |
| 40 | 'volume_metadata_update', 'volume_metadata_update_key', |
| 41 | 'volume_type_list', 'volume_type_get_details', |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 42 | 'volume_type_create', 'keys_volume_type_get', |
Oleksiy Petrenko | e38f5a6 | 2018-11-21 12:58:07 +0200 | [diff] [blame] | 43 | 'keys_volume_type_set', 'volume_type_delete', |
Oleksandr Shyshko | 04099ea | 2018-11-22 16:02:52 +0200 | [diff] [blame] | 44 | 'image_upload_volume', 'service_list', 'service_update', 'service_wait') |
kairat_kushaev | 5c8626d | 2018-06-09 18:15:15 +0400 | [diff] [blame] | 45 | |
| 46 | def __virtual__(): |
| 47 | if REQUIREMENTS_MET: |
| 48 | return 'cinderv3' |
| 49 | else: |
| 50 | return False, ("The cinderv3 execution module cannot be loaded: " |
| 51 | "os_client_config are unavailable.") |