From 2272a00f77b73fd419b85cc15727fec283938f56 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Wed, 31 May 2017 10:15:16 -0700 Subject: [PATCH] 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 9b809fcc60d7e09b4f79fad0b992d0f27d2a100f) --- neutron/objects/extensions/standardattributes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neutron/objects/extensions/standardattributes.py b/neutron/objects/extensions/standardattributes.py index 3a8ebb830ce..813f52f66a6 100644 --- a/neutron/objects/extensions/standardattributes.py +++ b/neutron/objects/extensions/standardattributes.py @@ -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')