Issue #1303
closedUnitPublishStep will not work with mongoengine units
Description
If using a plugin that uses steps provided by the platform and is also converted to mongoengine, you'll find that at least UnitPublishStep will not work with mongoengine based units. For example you can checkout the in-progress 874-barleywine branch and reproduce with the lastest version of platform on HEAD of master.
pulp-admin login -u admin -p admin
pulp-admin rpm repo create --repo-id foo --feed http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/
pulp-admin rpm repo sync run --repo-id foo
The sync will succeed, but the publish will fail with the following traceback:
Task pulp.server.managers.repo.publish.publish[15fb1a8e-6eb7- 4b84-b499-f9a7b978fc5a] raised unexpected: KeyError('checksum_type',)
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/celery-3.1.11-py2.7. egg/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/bmbouter/Documents/pulp/server/pulp/server/asyn c/tasks.py", line 392, in __call__
return super(Task, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/celery-3.1.11-py2.7. egg/celery/app/trace.py", line 437, in __protected_call__
return self.run(*args, **kwargs)
File "/home/bmbouter/Documents/pulp/server/pulp/server/cont rollers/repository.py", line 725, in publish
result = _do_publish(repo_obj, dist_id, dist_inst, transf er_repo, conduit, call_config)
File "/home/bmbouter/Documents/pulp/server/pulp/server/cont rollers/repository.py", line 779, in _do_publish
publish_report = publish_repo(transfer_repo, conduit, cal l_config)
File "/home/bmbouter/Documents/pulp/server/pulp/server/asyn c/tasks.py", line 577, in wrap_f
return f(*args, **kwargs)
File "/home/bmbouter/Documents/pulp_rpm/plugins/pulp_rpm/plugins/distributors/yum/distributor.py", line 178, in publish_repo
return self._publisher.process_lifecycle()
File "/home/bmbouter/Documents/pulp/server/pulp/plugins/util/publish_step.py", line 531, in process_lifecycle
super(PluginStep, self).process_lifecycle()
File "/home/bmbouter/Documents/pulp/server/pulp/plugins/util/publish_step.py", line 133, in process_lifecycle
step.process()
File "/home/bmbouter/Documents/pulp/server/pulp/plugins/util/publish_step.py", line 215, in process
self._process_block()
File "/home/bmbouter/Documents/pulp/server/pulp/plugins/util/publish_step.py", line 697, in _process_block
for package_unit in package_unit_generator:
File "/home/bmbouter/Documents/pulp/server/pulp/plugins/conduits/mixins.py", line 712, in _transfer_object_generator
unit_key_fields_cache[type_id])
File "/home/bmbouter/Documents/pulp/server/pulp/plugins/conduits/_common.py", line 79, in to_plugin_associated_unit
unit_key[k] = pulp_unit['metadata'].pop(k)
KeyError: 'checksum_type'
Above you can see that once platform code starts running with the statement "/home/bmbouter/Documents/pulp/server/pulp/plugins/util/publish_step.py", line 531, in process_lifecycle the platform experiences the exception. I think the steps processing code in platform needs to be updated to do both:
- work with mongengine units and old-style units
- not use the conduits code since those are going to go away or be redefined in the future.
This could also be accomplished by having new classes created instead of burying the if-mongengine-else-*** logic.
Updated by mhrivnak about 8 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to mhrivnak
- Priority changed from Normal to High
- Triaged changed from No to Yes
Updated by bmbouter about 8 years ago
- Assignee changed from mhrivnak to bmbouter
Updated by mhrivnak about 8 years ago
- Status changed from ASSIGNED to MODIFIED
- Assignee changed from bmbouter to mhrivnak
I resolved this by adding a new step that works with models: https://github.com/pulp/pulp/pull/2192
Updated by dkliban@redhat.com almost 8 years ago
- Status changed from MODIFIED to 5
Updated by dkliban@redhat.com over 7 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE