Project

Profile

Help

Issue #1303

Updated by bmbouter over 8 years ago

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":https://github.com/pulp/pulp_rpm/compare/master...bmbouter:874-barleywine and reproduce with the lastest version of platform on HEAD of master. 

 <pre> 
 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 
 </pre> 


 The sync will succeed, but the publish will fail with the following traceback: 

 <pre> 
 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' 
 </pre> 

 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: 

 # (1) work with mongengine units and old-style units 
 # (2) 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.

Back