From baee7e89000b599b71e0deef990f65892b0c52b1 Mon Sep 17 00:00:00 2001 From: Roman Dobosz Date: Mon, 16 Nov 2015 16:08:10 +0100 Subject: [PATCH] Several typos fixed --- README.rst | 15 ++++++++++----- filter_vm_action.py | 4 ++-- host-evacuate.yaml | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index b854e1e..380d1f7 100644 --- a/README.rst +++ b/README.rst @@ -7,8 +7,8 @@ using Mistral. Installation ------------ -#. Copy ``filter_vm.py`` to the place reachable by python interpreter - see - ``PYTHONPATH`` or ``sys.path`` for reference. +#. Copy ``filter_vm_action.py`` to the place reachable by python interpreter - + see ``PYTHONPATH`` or ``sys.path`` for reference. #. Append line .. code:: ini @@ -16,7 +16,7 @@ Installation [entry_points] mistral.actions = … - custom.filter_vms = evac_poc:FilterAndEvacuate + custom.filter_vm = filter_vm_action:FilterVmAction to ``setup.cfg`` file under Mistral repository #. Reinstall Mistral if it was installed in system (not in virtualenv). @@ -36,7 +36,7 @@ Installation .. code:: shell-session - $ mistral workflow-create evacuate-workflow.yaml + $ mistral workflow-create host-evacuate.yaml #. Create JSON file with content similar to: @@ -49,4 +49,9 @@ Installation } #. Trigger the action via: - TBD + + .. code:: shell-session + + $ mistral execution-create host-evacuate input.json + + where ``input.json`` is a file created in previous step. diff --git a/filter_vm_action.py b/filter_vm_action.py index d2662c9..7f3e651 100644 --- a/filter_vm_action.py +++ b/filter_vm_action.py @@ -28,7 +28,7 @@ class FilterVmAction(NovaAction): if str(metadata.get('evacuate')).upper() == 'TRUE': return Result(data={'status': 0, 'uuid': self._uuid}) elif str(metadata.get('evacuate')).upper() == 'FALSE': - return Result(error='sie nie udalo!!!!1111jeden') + return Result(error='evacuate for vm %s is disabled' % self._uuid) # ether is no metadata for vm - check flavor flavors = client.flavors.list() @@ -42,4 +42,4 @@ class FilterVmAction(NovaAction): if str(evacuate).upper() == 'TRUE': return Result(data={'status': 0, 'uuid': self._uuid}) - return Result(data='1', error=True) + return Result(error='evacuate for vm %s is disabled' % self._uuid) diff --git a/host-evacuate.yaml b/host-evacuate.yaml index eb5c938..0aae68f 100644 --- a/host-evacuate.yaml +++ b/host-evacuate.yaml @@ -20,7 +20,7 @@ host-evacuate: filter_vms: with-items: vm in <% $.vms %> - action: custom.filter_vms flavor=<% $.vm.flavor.id %> metadata=<% $.vm.metadata %> uuid=<% $.vm.id %> + action: custom.filter_vm flavor=<% $.vm.flavor.id %> metadata=<% $.vm.metadata %> uuid=<% $.vm.id %> publish: filtered_vms: <% $.filter_vms.uuid %> on-success: evacuate_vms