From a45b1f9feb3f0d2a427f5a25e256f0f7fbb59cd7 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 6 Sep 2017 10:36:58 +0100 Subject: [PATCH] Add exception when a synthetic field is invalid A check is introduced in the ``__init__`` method of ``NeutronObject`` class [1]. This check ensures synthetic fields are valid in any oslo versioned object. [1] I33c41fbd4dd40ba292ebe67ac497372d4354f260 Change-Id: I12c7a330555966d30e44418cbd500958fe844462 Closes-Bug: #1614478 --- neutron_lib/objects/exceptions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neutron_lib/objects/exceptions.py b/neutron_lib/objects/exceptions.py index 5f17c3d98..32ec3d05a 100644 --- a/neutron_lib/objects/exceptions.py +++ b/neutron_lib/objects/exceptions.py @@ -60,3 +60,8 @@ class NeutronSyntheticFieldMultipleForeignKeys(exceptions.NeutronException): class NeutronSyntheticFieldsForeignKeysNotFound(exceptions.NeutronException): message = _("%(child)s does not define a foreign key for %(parent)s") + + +class NeutronObjectValidatorException(exceptions.NeutronException): + message = _("Synthetic field(s) %(fields)s undefined, misspelled, or " + "otherwise invalid")