Project

Profile

Help

Issue #1239

closed

Refactor #765: Convert Pulp to use MongoEngine

Pulp FileDistributor base class raises exception when operating on mongoengine based unit

Added by bmbouter about 9 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

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.


Related issues

Related to Pulp - Task #1212: Fix Unit removal. It does not work with mongoengine modelsCLOSED - CURRENTRELEASEmhrivnak

Actions
Related to Puppet Support - Issue #1215: Unit removal --type doesn't work with mongoengine converted typesCLOSED - CURRENTRELEASEmhrivnakActions

Also available in: Atom PDF