Type inheritance is ignored when coercing object fields
Bug #1466141 reported by
Alexander Tivelkov
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.
pass
class Bar(Foo):
pass
foo = Foo()
bar = Bar()
field = fields.
field.coerce(None, None, foo)
field.coerce(None, None, bar) # should pass, as bar is instance of Foo, but fails
To post a comment you must log in.
This bug has been open for a long time, can anyone confirm that it's still present in the current version?