Type inheritance is ignored when coercing object fields

Bug #1466141 reported by Alexander Tivelkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.versionedobjects
Expired
Undecided
Unassigned

Bug Description

An Object field type coerces its values by comparing its obj_name() (if present) with the one required by contract.
This ignores object inheritance.

For example:

class Foo(base.VersionedObject):
    pass

class Bar(Foo):
    pass

foo = Foo()
bar = Bar()
field = fields.Field(fields.Object(obj_name="Foo"))
field.coerce(None, None, foo)
field.coerce(None, None, bar) # should pass, as bar is instance of Foo, but fails

Revision history for this message
Ben Nemec (bnemec) wrote :

This bug has been open for a long time, can anyone confirm that it's still present in the current version?

Changed in oslo.versionedobjects:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for oslo.versionedobjects because there has been no activity for 60 days.]

Changed in oslo.versionedobjects:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.