mirror of
https://github.com/gryf/mistral-evacuate.git
synced 2026-03-04 15:55:50 +01:00
Several typos fixed
This commit is contained in:
15
README.rst
15
README.rst
@@ -7,8 +7,8 @@ using Mistral.
|
|||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
#. Copy ``filter_vm.py`` to the place reachable by python interpreter - see
|
#. Copy ``filter_vm_action.py`` to the place reachable by python interpreter -
|
||||||
``PYTHONPATH`` or ``sys.path`` for reference.
|
see ``PYTHONPATH`` or ``sys.path`` for reference.
|
||||||
#. Append line
|
#. Append line
|
||||||
|
|
||||||
.. code:: ini
|
.. code:: ini
|
||||||
@@ -16,7 +16,7 @@ Installation
|
|||||||
[entry_points]
|
[entry_points]
|
||||||
mistral.actions =
|
mistral.actions =
|
||||||
…
|
…
|
||||||
custom.filter_vms = evac_poc:FilterAndEvacuate
|
custom.filter_vm = filter_vm_action:FilterVmAction
|
||||||
|
|
||||||
to ``setup.cfg`` file under Mistral repository
|
to ``setup.cfg`` file under Mistral repository
|
||||||
#. Reinstall Mistral if it was installed in system (not in virtualenv).
|
#. Reinstall Mistral if it was installed in system (not in virtualenv).
|
||||||
@@ -36,7 +36,7 @@ Installation
|
|||||||
|
|
||||||
.. code:: shell-session
|
.. code:: shell-session
|
||||||
|
|
||||||
$ mistral workflow-create evacuate-workflow.yaml
|
$ mistral workflow-create host-evacuate.yaml
|
||||||
|
|
||||||
#. Create JSON file with content similar to:
|
#. Create JSON file with content similar to:
|
||||||
|
|
||||||
@@ -49,4 +49,9 @@ Installation
|
|||||||
}
|
}
|
||||||
|
|
||||||
#. Trigger the action via:
|
#. 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.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class FilterVmAction(NovaAction):
|
|||||||
if str(metadata.get('evacuate')).upper() == 'TRUE':
|
if str(metadata.get('evacuate')).upper() == 'TRUE':
|
||||||
return Result(data={'status': 0, 'uuid': self._uuid})
|
return Result(data={'status': 0, 'uuid': self._uuid})
|
||||||
elif str(metadata.get('evacuate')).upper() == 'FALSE':
|
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
|
# ether is no metadata for vm - check flavor
|
||||||
flavors = client.flavors.list()
|
flavors = client.flavors.list()
|
||||||
@@ -42,4 +42,4 @@ class FilterVmAction(NovaAction):
|
|||||||
if str(evacuate).upper() == 'TRUE':
|
if str(evacuate).upper() == 'TRUE':
|
||||||
return Result(data={'status': 0, 'uuid': self._uuid})
|
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)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ host-evacuate:
|
|||||||
|
|
||||||
filter_vms:
|
filter_vms:
|
||||||
with-items: vm in <% $.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:
|
publish:
|
||||||
filtered_vms: <% $.filter_vms.uuid %>
|
filtered_vms: <% $.filter_vms.uuid %>
|
||||||
on-success: evacuate_vms
|
on-success: evacuate_vms
|
||||||
|
|||||||
Reference in New Issue
Block a user