1
0
mirror of https://github.com/gryf/mistral-evacuate.git synced 2026-02-07 16:55:52 +01:00
Files
mistral-evacuate/evacuate_vm_action.py
Dawid Deja 503c35c435 Add new action so it can use filtered data
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>
2016-02-02 15:13:46 +01:00

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)