diff --git a/watcher/applier/actions/nop.py b/watcher/applier/actions/nop.py index 6d80520f4..2b3c86971 100644 --- a/watcher/applier/actions/nop.py +++ b/watcher/applier/actions/nop.py @@ -17,9 +17,8 @@ # limitations under the License. # +import jsonschema from oslo_log import log -import six -import voluptuous from watcher.applier.actions import base @@ -42,10 +41,23 @@ class Nop(base.BaseAction): @property def schema(self): - return voluptuous.Schema({ - voluptuous.Required(self.MESSAGE): voluptuous.Any( - voluptuous.Any(*six.string_types), None) - }) + return { + 'type': 'object', + 'properties': { + 'message': { + 'type': ['string', 'null'] + } + }, + 'required': ['message'], + 'additionalProperties': False, + } + + def validate_parameters(self): + try: + jsonschema.validate(self.input_parameters, self.schema) + return True + except jsonschema.ValidationError as e: + raise e @property def message(self):