kairat_kushaev | 6685262 | 2018-06-07 17:27:35 +0400 | [diff] [blame] | 1 | """ |
| 2 | Module for handling Heat stacks. |
| 3 | |
| 4 | :depends: - os_client_config |
| 5 | :configuration: This module is not usable until the following are specified |
| 6 | """ |
| 7 | |
| 8 | try: |
| 9 | import os_client_config |
| 10 | REQUIREMENTS_MET = True |
| 11 | except ImportError: |
| 12 | REQUIREMENTS_MET = False |
| 13 | |
| 14 | import os |
| 15 | import sys |
| 16 | |
| 17 | # i failed to load module witjout this |
| 18 | # seems bugs in salt or it is only me |
| 19 | sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) |
| 20 | |
| 21 | import stack |
| 22 | |
| 23 | stack_create = stack.stack_create |
| 24 | stack_delete = stack.stack_delete |
| 25 | stack_list = stack.stack_list |
| 26 | stack_show = stack.stack_show |
| 27 | stack_update = stack.stack_update |
| 28 | |
| 29 | __all__ = ('stack_create', 'stack_list', 'stack_delete', 'stack_show', |
| 30 | 'stack_update') |
| 31 | |
| 32 | |
| 33 | def __virtual__(): |
| 34 | if REQUIREMENTS_MET: |
| 35 | return 'heatv1' |
| 36 | else: |
| 37 | return False, ("The heat execution module cannot be loaded: " |
| 38 | "os_client_config is not available.") |