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
This commit is contained in:
Rodolfo Alonso Hernandez 2017-09-06 10:36:58 +01:00
parent d01e189c1d
commit a45b1f9feb
1 changed files with 5 additions and 0 deletions

View File

@ -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")