diff options
author | Davanum Srinivas <davanum@gmail.com> | 2015-10-07 08:11:35 -0700 |
---|---|---|
committer | Sean Dague <sean@dague.net> | 2015-10-13 07:57:52 -0400 |
commit | 6df6ad3ff32f2b1fe2978df1032002548ad8eb66 (patch) | |
tree | a6dd02f796a72aa8d4291b400049e7d870954e8a | |
parent | ba6fccc794269b9d9c0e367c269cd488ec9df6fd (diff) | |
download | nova-12.0.0.tar.gz |
Omnibus stable/liberty fix12.0.0.0rc312.0.0
There are currently 3 different blocking issues in stable/liberty due
to library releases: webob 1.5, oslo.db 3.0.0, and
oslo.versionedobjects 0.11.0. This is a squashed fix for all of them
as none can land without the others.
Issue #1 - oslo.db
Add testresources used by oslo.db fixture
If we use oslo.db fixtures, we'll need the package or
the next version of oslo.db release will break us.
(Cherry-picked from 4bcc26487837b7ece7797f88622dea1b6d09bd94)
Closes-Bug: #1503501
Issue #2 - oslo.versionedobjects
Drop unused obj_to_primitive() override
This was a band-aid override until o.vo gained the obj_relationships fix
that this method overrides. That has been in place since o.vo 0.8.0, which
means this is long since no longer necessary (and is actually blocking our
ability to absorb bug fixes to this code in o.vo). Further, we no longer
use this directly because we're doing backports based on version manifests,
which means we no longer consult child_versions _or_ obj_relationships.
(cherry picked from commit 142f1d9cc4ace90956c665c40b1f78795f9f7e29)
Issue #3 - webob
Default ConvertedException code to 500
webob 1.5.0 released on 10/11 has change f6c749011 which
strictly enforces status codes in exceptions, and 0 is not
a valid status code so tests fail.
Change the default to 500 to match the default in the parent
class in webob.
Closes-Bug: #1505153
(cherry picked from commit 10438c0fc34bd088e018e1a5e8ec57b396528792)
Change-Id: I1e06e77308a7dd23209124f0807d61fb52470188
-rw-r--r-- | nova/exception.py | 2 | ||||
-rw-r--r-- | nova/objects/base.py | 36 | ||||
-rw-r--r-- | test-requirements.txt | 1 |
3 files changed, 2 insertions, 37 deletions
diff --git a/nova/exception.py b/nova/exception.py index 9e75bae76d..1108c14149 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -47,7 +47,7 @@ CONF.register_opts(exc_log_opts) class ConvertedException(webob.exc.WSGIHTTPException): - def __init__(self, code=0, title="", explanation=""): + def __init__(self, code=500, title="", explanation=""): self.code = code self.title = title self.explanation = explanation diff --git a/nova/objects/base.py b/nova/objects/base.py index 5c25976ec6..9669f74d95 100644 --- a/nova/objects/base.py +++ b/nova/objects/base.py @@ -249,42 +249,6 @@ class ObjectListBase(ovoo_base.ObjectListBase): else: return primitive.get(key, default) - # NOTE(rlrossit): This can get removed after ovo uses both child_versions - # and obj_relationships when making the internal objects compatible - def obj_make_compatible(self, primitive, target_version): - primitives = primitive['objects'] - target_version = utils.convert_version_to_tuple(target_version) - if self.child_versions: - child_target_version = self.child_versions.get(target_version, - '1.0') - else: - child_target_version = '1.0' - rel_versions = self.obj_relationships['objects'] - for index, versions in enumerate(rel_versions): - my_version, child_version = versions - my_version = utils.convert_version_to_tuple(my_version) - if target_version < my_version: - if index == 0: - # if the target is before we existed, delete objects - # from the primitive - # (we should never get here, because lists should - # always have an 'objects' field) - del primitive['objects'] - else: - # We still don't match, but we'll grab the latest - # child version up to this point - child_target_version = rel_versions[index - 1][1] - elif target_version == my_version: - child_target_version = child_version - break - - for index, item in enumerate(self.objects): - self.objects[index].obj_make_compatible( - self._obj_primitive_field(primitives[index], 'data'), - child_target_version) - verkey = self._obj_primitive_key('version') - primitives[index][verkey] = child_target_version - class NovaObjectSerializer(messaging.NoOpSerializer): """A NovaObject-aware Serializer. diff --git a/test-requirements.txt b/test-requirements.txt index 735167c274..fd27b73727 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -21,6 +21,7 @@ sphinxcontrib-seqdiag oslosphinx>=2.5.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 testrepository>=0.0.18 +testresources>=0.2.4 testtools>=1.4.0 tempest-lib>=0.8.0 bandit>=0.13.2 |