mirror of
https://github.com/gryf/mistral-evacuate.git
synced 2026-02-07 16:55:52 +01:00
This commit adds evacuate_vm_action which is a wrapper for nova.evacuate API call, but it checks the result of filtering from previous step, before executing evacuation. Also change a little bit workflow and filter action, so they suit new approach Signed-off-by: Dawid Deja <dawid.deja@intel.com>
18 lines
520 B
Python
18 lines
520 B
Python
from mistral.actions.openstack.actions import NovaAction
|
|
from mistral.workflow.utils import Result
|
|
|
|
|
|
class EvacuateVmAction(NovaAction):
|
|
|
|
def __init__(self, uuid, on_shared_storage, evacuate):
|
|
self._uuid = uuid
|
|
self._on_shared_storage = on_shared_storage
|
|
self._evacuate = evacuate
|
|
|
|
def run(self):
|
|
client = self._get_client()
|
|
|
|
if self._evacuate:
|
|
client.servers.evacuate(self._uuid,
|
|
on_shared_storage=self._on_shared_storage)
|