1
0
mirror of https://github.com/gryf/mistral-evacuate.git synced 2026-04-28 07:23:32 +02:00

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>
This commit is contained in:
Dawid Deja
2016-02-02 15:13:46 +01:00
parent 992af39ce0
commit 503c35c435
4 changed files with 35 additions and 13 deletions
+17
View File
@@ -0,0 +1,17 @@
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)