Add action description
Add action get_description in class BaseAction. This information will be sent to the API side via notification. Partially Implements: blueprint dynamic-action-description Change-Id: I9ce1b18ad8c5eb7db62ec926d1859d0f508074b0
This commit is contained in:
@@ -129,3 +129,8 @@ class BaseAction(loadable.Loadable):
|
|||||||
def validate_parameters(self):
|
def validate_parameters(self):
|
||||||
self.schema(self.input_parameters)
|
self.schema(self.input_parameters)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
def get_description(self):
|
||||||
|
"""Description of the action"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|||||||
@@ -101,3 +101,9 @@ class ChangeNovaServiceState(base.BaseAction):
|
|||||||
|
|
||||||
def post_condition(self):
|
def post_condition(self):
|
||||||
pass
|
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.")
|
||||||
|
|||||||
@@ -172,3 +172,7 @@ class Migrate(base.BaseAction):
|
|||||||
def post_condition(self):
|
def post_condition(self):
|
||||||
# TODO(jed): check extra parameters (network response, etc.)
|
# TODO(jed): check extra parameters (network response, etc.)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
"""Description of the action"""
|
||||||
|
return "Moving a VM instance from source_node to destination_node"
|
||||||
|
|||||||
@@ -65,3 +65,7 @@ class Nop(base.BaseAction):
|
|||||||
|
|
||||||
def post_condition(self):
|
def post_condition(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
"""Description of the action"""
|
||||||
|
return "Logging a NOP message"
|
||||||
|
|||||||
@@ -104,3 +104,7 @@ class Resize(base.BaseAction):
|
|||||||
def post_condition(self):
|
def post_condition(self):
|
||||||
# TODO(jed): check extra parameters (network response, etc.)
|
# TODO(jed): check extra parameters (network response, etc.)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
"""Description of the action"""
|
||||||
|
return "Resize a server with specified flavor."
|
||||||
|
|||||||
@@ -66,3 +66,7 @@ class Sleep(base.BaseAction):
|
|||||||
|
|
||||||
def post_condition(self):
|
def post_condition(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
"""Description of the action"""
|
||||||
|
return "Wait for a given interval in seconds."
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ class FakeAction(abase.BaseAction):
|
|||||||
def execute(self):
|
def execute(self):
|
||||||
raise ExpectedException()
|
raise ExpectedException()
|
||||||
|
|
||||||
|
def get_description(self):
|
||||||
|
return "fake action, just for test"
|
||||||
|
|
||||||
|
|
||||||
class TestDefaultWorkFlowEngine(base.DbTestCase):
|
class TestDefaultWorkFlowEngine(base.DbTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user