diff --git a/ironic/common/exception.py b/ironic/common/exception.py index ce3654de8b..4352ee8bc8 100644 --- a/ironic/common/exception.py +++ b/ironic/common/exception.py @@ -611,11 +611,6 @@ class IncompleteLookup(Invalid): "is required") -class NotificationEventTypeError(IronicException): - _msg_fmt = _('Expected "status" to be one of "start", "end", ' - '"error", or "success", but got "%(status)s"') - - class NotificationSchemaObjectError(IronicException): _msg_fmt = _("Expected object %(obj)s when populating notification payload" " but got object %(source)s") diff --git a/ironic/objects/notification.py b/ironic/objects/notification.py index 730d2d02b2..bb3e379a4d 100644 --- a/ironic/objects/notification.py +++ b/ironic/objects/notification.py @@ -51,8 +51,6 @@ class EventType(base.IronicObject): } def to_event_type_field(self): - if self.status not in ['start', 'end', 'error', 'success']: - raise exception.NotificationEventTypeError(status=self.status) parts = ['baremetal', self.object, self.action, self.status] return '.'.join(parts) diff --git a/ironic/tests/unit/objects/test_notification.py b/ironic/tests/unit/objects/test_notification.py index 6483bfb851..4adc6a01f6 100644 --- a/ironic/tests/unit/objects/test_notification.py +++ b/ironic/tests/unit/objects/test_notification.py @@ -246,3 +246,11 @@ class TestNotificationBase(test_base.TestCase): self.assertRaises(ValueError, notification.EventType, object="some_obj", action="some_action", status="invalid") + + def test_event_type_make_status_invalid(self): + def make_status_invalid(): + event_type.status = "Roar" + + event_type = notification.EventType( + object='test_object', action='test', status='start') + self.assertRaises(ValueError, make_status_invalid)