Refactor #765: Convert Pulp to use MongoEngine
Pulp FileDistributor base class raises exception when operating on mongoengine based unit
If you have a mongoengine converted unit type, you cannot publish it using the platform's FileDistributor even if the plugin's subclass of FileDistributor has been correctly implemented. For example if platform is at HEAD of master, and you test against the in-development puppet conversion to mongoengine then you can run the following commands to cause this failure using a mixture of pulp-admin and httpie:
pulp-admin -u admin -p admin puppet repo create --repo-id=zoo-puppet --feed=http://forge.puppetlabs.com --queries torssh pulp-admin puppet repo sync run --repo-id zoo-puppet http --verify no --auth admin:admin POST https://localhost/pulp/api/v2/repositories/zoo-puppet/distributors/ distributor_type_id=puppet_file_distributor distributor_id=asdf http --verify no --auth admin:admin POST https://localhost/pulp/api/v2/repositories/zoo-puppet/actions/publish/ id='asdf
You'll see the following traceback in the celery worker running the publish for distributor=asdf:
Exception from server requesting all content units for repository [zoo-puppet] Traceback (most recent call last): File "/home/bmbouter/Documents/pulp/server/pulp/plugins/conduits/mixins.py", line 716, in do_get_repo_units return list(_transfer_object_generator()) File "/home/bmbouter/Documents/pulp/server/pulp/plugins/conduits/mixins.py", line 709, in _transfer_object_generator type_def = type_defs[type_id] KeyError: u'puppet_module'
It would be good if this was fixed in a way that generalized to more gracefully handle type_def lookup failures all over the codebase.