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 |
| 6 | import os |
| 7 | import sys |
| 8 | |
| 9 | # i failed to load module witjout this |
| 10 | # seems bugs in salt or it is only me |
| 11 | sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) |
| 12 | |
| 13 | import volume |
| 14 | |
| 15 | volume_list = volume.volume_list |
| 16 | volume_type_list = volume.volume_type_list |
| 17 | volume_type_get = volume.volume_type_get |
| 18 | volume_type_create = volume.volume_type_create |
| 19 | volume_type_delete = volume.volume_type_delete |
| 20 | keys_volume_type_get = volume.keys_volume_type_get |
| 21 | keys_volume_type_set = volume.keys_volume_type_set |
| 22 | |
| 23 | __all__ = ('volume_list', 'volume_type_list', 'volume_type_get', |
| 24 | 'volume_type_create', 'keys_volume_type_get', |
| 25 | 'keys_volume_type_set', 'volume_type_delete') |
| 26 | |
| 27 | |
| 28 | def __virtual__(): |
| 29 | if REQUIREMENTS_MET: |
| 30 | return 'cinderv3' |
| 31 | else: |
| 32 | return False, ("The cinderv3 execution module cannot be loaded: " |
| 33 | "os_client_config are unavailable.") |