Issue #1384
closedHTTP 500 when retrieving importers that have with null configs
Description
It is possible(Pulp < 2.8) to have null values in the db for the `config` field of an importer. This breaks the serializer which was new in 2.7.0.
This is how to reproduce:
1. Create a repository without importers or distributors (do not use CLI)
http --json -a admin:admin --verify=no POST https://localhost/pulp/api/v2/repositories/ id=test
2. Associate an importer with this repository
http --json -a admin:admin --verify=no POST 'https://localhost/pulp/api/v2/repositories/test/importers/' importer_type_id=yum_importer
3. Attempt to retrieve the importer
http --json -a admin:admin --verify=no GET 'https://localhost/pulp/api/v2/repositories/test/?importers=true'
I have confirmed that this is not a problem for Pulp < 2.7.0 and that it is not a problem for Pulp >= 2.8. The broken serializer did not exist previously, and the Mongoengine documents convert `null` to an empty dict because `config` is a DictField.
This could be an issue in other places in the API, and if those objects have not been converted to Mongoengine they will be broken in master as well.
The specific cause is that the base serializer allows modification (removal and masking) of fields within an object, and it assumed that the fields being modified exist.
Added by Austin Macdonald about 9 years ago
Added by Austin Macdonald about 9 years ago
Revision 0ca55a52 | View on GitHub
serializer should not fail if masked field is None
closes #1384
Updated by amacdona@redhat.com about 9 years ago
- Status changed from NEW to ASSIGNED
Updated by amacdona@redhat.com about 9 years ago
- Status changed from ASSIGNED to MODIFIED
Updated by Anonymous about 9 years ago
- % Done changed from 0 to 100
Applied in changeset pulp|0ca55a5240c256d3cf7f29abe0dc39cbab6d447b.
Updated by amacdona@redhat.com about 9 years ago
- Platform Release changed from 2.7.1 to 2.7.2
Updated by dkliban@redhat.com almost 9 years ago
- Status changed from MODIFIED to 5
Updated by semyers over 8 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
- Platform Release changed from 2.7.2 to 2.8.0
serializer should not fail if masked field is None
closes #1384