diff --git a/watcher/applier/actions/base.py b/watcher/applier/actions/base.py index 4286b104b..6bffa5044 100644 --- a/watcher/applier/actions/base.py +++ b/watcher/applier/actions/base.py @@ -129,3 +129,8 @@ class BaseAction(loadable.Loadable): def validate_parameters(self): self.schema(self.input_parameters) return True + + @abc.abstractmethod + def get_description(self): + """Description of the action""" + raise NotImplementedError() diff --git a/watcher/applier/actions/change_nova_service_state.py b/watcher/applier/actions/change_nova_service_state.py index 50017c156..201a3c5fe 100644 --- a/watcher/applier/actions/change_nova_service_state.py +++ b/watcher/applier/actions/change_nova_service_state.py @@ -101,3 +101,9 @@ class ChangeNovaServiceState(base.BaseAction): def post_condition(self): pass + + def get_description(self): + """Description of the action""" + return ("Disables or enables the nova-compute service." + "A disabled nova-compute service can not be selected " + "by the nova for future deployment of new server.") diff --git a/watcher/applier/actions/migration.py b/watcher/applier/actions/migration.py index eb742fae6..663f84f30 100644 --- a/watcher/applier/actions/migration.py +++ b/watcher/applier/actions/migration.py @@ -172,3 +172,7 @@ class Migrate(base.BaseAction): def post_condition(self): # TODO(jed): check extra parameters (network response, etc.) pass + + def get_description(self): + """Description of the action""" + return "Moving a VM instance from source_node to destination_node" diff --git a/watcher/applier/actions/nop.py b/watcher/applier/actions/nop.py index 59ad241f1..0a4969b18 100644 --- a/watcher/applier/actions/nop.py +++ b/watcher/applier/actions/nop.py @@ -65,3 +65,7 @@ class Nop(base.BaseAction): def post_condition(self): pass + + def get_description(self): + """Description of the action""" + return "Logging a NOP message" diff --git a/watcher/applier/actions/resize.py b/watcher/applier/actions/resize.py index ea9df82fb..920c62fb4 100644 --- a/watcher/applier/actions/resize.py +++ b/watcher/applier/actions/resize.py @@ -104,3 +104,7 @@ class Resize(base.BaseAction): def post_condition(self): # TODO(jed): check extra parameters (network response, etc.) pass + + def get_description(self): + """Description of the action""" + return "Resize a server with specified flavor." diff --git a/watcher/applier/actions/sleep.py b/watcher/applier/actions/sleep.py index abb83eab4..f472eeddc 100644 --- a/watcher/applier/actions/sleep.py +++ b/watcher/applier/actions/sleep.py @@ -66,3 +66,7 @@ class Sleep(base.BaseAction): def post_condition(self): pass + + def get_description(self): + """Description of the action""" + return "Wait for a given interval in seconds." diff --git a/watcher/tests/applier/workflow_engine/test_default_workflow_engine.py b/watcher/tests/applier/workflow_engine/test_default_workflow_engine.py index fd72c3349..5452db890 100644 --- a/watcher/tests/applier/workflow_engine/test_default_workflow_engine.py +++ b/watcher/tests/applier/workflow_engine/test_default_workflow_engine.py @@ -52,6 +52,9 @@ class FakeAction(abase.BaseAction): def execute(self): raise ExpectedException() + def get_description(self): + return "fake action, just for test" + class TestDefaultWorkFlowEngine(base.DbTestCase): def setUp(self):