Project

Profile

Help

Task #1212

closed

Refactor #765: Convert Pulp to use MongoEngine

Fix Unit removal. It does not work with mongoengine models

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:
% Done:

100%

Estimated time:
Platform Release:
2.8.0
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

If you have a mongoengine converted repo with a unit in it you cannot remove that unit by name. For example if testing against the in-development puppet conversion to mongoengine then you can run the following commands to cause this failure:

pulp-admin login -u admin -p admin
pulp-admin puppet repo create --repo-id=forge --feed=http://forge.puppetlabs.com --queries torssh
pulp-admin puppet repo sync run --repo-id forge
pulp-admin puppet repo remove --repo-id forge --str-eq="name=torssh"

You'll see the following traceback in the celery worker running the unit removal task code:

  File "/home/bmbouter/Documents/pulp/server/pulp/server/managers/repo/unit_association.py", line 336, in unassociate_by_criteria
    transfer_units = create_transfer_units(unassociate_units, unit_type_ids)
  File "/home/bmbouter/Documents/pulp/server/pulp/server/managers/repo/unit_association.py", line 410, in create_transfer_units
    u = conduit_common_utils.to_plugin_associated_unit(unit, type_defs[type_id])
  File "/home/bmbouter/Documents/pulp/server/pulp/plugins/conduits/_common.py", line 76, in to_plugin_associated_unit
    key_list = type_def['unit_key'] 
TypeError: 'NoneType' object has no attribute '__getitem__'

Related issues

Related to Pulp - Issue #1239: Pulp FileDistributor base class raises exception when operating on mongoengine based unitCLOSED - CURRENTRELEASEmhrivnakActions

Also available in: Atom PDF