diff options
-rw-r--r-- | nova/objects/build_request.py | 5 | ||||
-rw-r--r-- | nova/tests/unit/objects/test_build_request.py | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/nova/objects/build_request.py b/nova/objects/build_request.py index 6553dc4598..306e1d2947 100644 --- a/nova/objects/build_request.py +++ b/nova/objects/build_request.py @@ -72,7 +72,7 @@ class BuildRequest(base.NovaObject): LOG.debug('Failed to load instance from BuildRequest with uuid ' '%s because it is None', self.instance_uuid) raise exception.BuildRequestNotFound(uuid=self.instance_uuid) - except ovoo_exc.IncompatibleObjectVersion as exc: + except ovoo_exc.IncompatibleObjectVersion: # This should only happen if proper service upgrade strategies are # not followed. Log the exception and raise BuildRequestNotFound. # If the instance can't be loaded this object is useless and may @@ -81,7 +81,8 @@ class BuildRequest(base.NovaObject): 'with uuid %(instance_uuid)s. Found version %(version)s ' 'which is not supported here.', dict(instance_uuid=self.instance_uuid, - version=exc.objver)) + version=jsonutils.loads( + db_instance)["nova_object.version"])) LOG.exception(_LE('Could not deserialize instance in ' 'BuildRequest')) raise exception.BuildRequestNotFound(uuid=self.instance_uuid) diff --git a/nova/tests/unit/objects/test_build_request.py b/nova/tests/unit/objects/test_build_request.py index a124581076..c4b654cde9 100644 --- a/nova/tests/unit/objects/test_build_request.py +++ b/nova/tests/unit/objects/test_build_request.py @@ -59,7 +59,7 @@ class _TestBuildRequestObject(object): instance = fake_instance.fake_instance_obj(self.context, objects.Instance, uuid=fake_req['instance_uuid']) instance.VERSION = '99' - fake_req['instance'] = jsonutils.dumps(instance.obj_to_primitive) + fake_req['instance'] = jsonutils.dumps(instance.obj_to_primitive()) get_by_uuid.return_value = fake_req self.assertRaises(exception.BuildRequestNotFound, |