objects: exclude revision_number from updatable fields

Revision service plugin is the entity that updates the database model
attribute, and we don't allow to modify the attribute on API layer. We
should not allow to explicitly update it on OVO layer either.

This can help with spurious unit test failures that sometimes try to
update revision number and then reuse the same number to fetch the
object. If revision service plugin decides to bump the number during the
test case execution once more, using the old number may yield no
results.

Conflicts:
	neutron/objects/extensions/standardattributes.py

Closes-Bug: #1694753
Change-Id: I4666c672223ac38508738b739207f754847c62bc
(cherry picked from commit 9b809fcc60)
This commit is contained in:
Ihar Hrachyshka 2017-05-31 10:15:16 -07:00 committed by Jakub Libosvar
parent 4bc7a5e687
commit 2272a00f77
1 changed files with 3 additions and 0 deletions

View File

@ -25,3 +25,6 @@ def add_standard_attributes(cls):
# its own instance of list
cls.fields = cls.fields.copy()
cls.fields.update(STANDARD_ATTRIBUTES)
# revision numbers are managed by service plugin and are bumped
# automatically; consumers should not bump them explicitly
cls.fields_no_update.append('revision_number')