Omnibus stable/liberty fix
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 from4bcc264878
) 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 commit142f1d9cc4
) 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 commit10438c0fc3
) Change-Id: I1e06e77308a7dd23209124f0807d61fb52470188
This commit is contained in:
parent
ba6fccc794
commit
6df6ad3ff3
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue