Compound fields do not coerce values of their elements when modified
Bug #1466057 reported by
Alexander Tivelkov
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.versionedobjects |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Compound fields coerce the values of their elements only during initial assignment. When the field is modified afterwards, no coercing happens, thus collections may get invalid values.
For example:
@base.Versioned
class Foo(base.
fields = {
"bar": fields.
}
f = Foo(bar=[42])
# All the lines below should fail, as "blah" can't be coerced to Integer, but actually they all work:
f.bar[0] = "blah"
f.bar.append(
f.bar.extend(
f.bar.insert(0, "blah")
Changed in oslo.versionedobjects: | |
assignee: | nobody → Alexander Tivelkov (ativelkov) |
Changed in oslo.versionedobjects: | |
status: | In Progress → Confirmed |
Changed in oslo.versionedobjects: | |
assignee: | Alexander Tivelkov (ativelkov) → nobody |
To post a comment you must log in.
Alexander,
was this about the change that was reverted?
https:/ /review. openstack. org/#/c/ 196926/