From 4cfaa7669297c095990a0af14ee60d1098baf366 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Thu, 8 Sep 2016 18:28:58 +0200 Subject: [PATCH] Have a default OPTIONAL_FIELDS for persistent OVOs Conditional update method from the persistent OVO class is blindly relying on persistent OVOs having an OPTIONAl_FIELDS attribute without defining a default. This patch adds an empty default so we can do conditional updates on persistent OVO instances that don't have optional fields. Change-Id: Icf640da34df0990b5ad2609d5d230ac9b0a51311 (cherry picked from commit 2987b33970bc0c04ee70007c1e4d378b6700f301) --- cinder/objects/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cinder/objects/base.py b/cinder/objects/base.py index fd202cb71..be7eb426f 100644 --- a/cinder/objects/base.py +++ b/cinder/objects/base.py @@ -223,6 +223,8 @@ class CinderPersistentObject(object): This adds the fields that we use in common for all persistent objects. """ + OPTIONAL_FIELDS = [] + Not = db.Not Case = db.Case