From 9f6d63c850934f93aada65cad2cf69ace839f6cb Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Thu, 6 Jun 2013 09:12:43 -0700 Subject: Fix obj_load() in NovaObject base class The obj_load_attr() method is correctly used in the field getter, but incorrectly provided in the base class (without the _attr suffix). Rename that and add a test for the base class that makes sure this method gets poked appropriately. Related to blueprint unified-object-model Change-Id: I3b010ef727fed2f59fbb3d7173078b1dbc4b81f6 --- nova/objects/base.py | 2 +- nova/objects/instance.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/objects') diff --git a/nova/objects/base.py b/nova/objects/base.py index 09d59b772..2e0797477 100644 --- a/nova/objects/base.py +++ b/nova/objects/base.py @@ -42,7 +42,7 @@ def make_class_properties(cls): def getter(self, name=name, typefn=typefn): attrname = get_attrname(name) if not hasattr(self, attrname): - self.obj_load(name) + self.obj_load_attr(name) return getattr(self, attrname) def setter(self, value, name=name, typefn=typefn): diff --git a/nova/objects/instance.py b/nova/objects/instance.py index 18fdfb94d..aec6fe968 100644 --- a/nova/objects/instance.py +++ b/nova/objects/instance.py @@ -257,7 +257,7 @@ class Instance(base.NovaObject): self[field] != current[field]): self[field] = current[field] - def obj_load(self, attrname): + def obj_load_attr(self, attrname): extra = [] if attrname == 'system_metadata': extra.append('system_metadata') -- cgit