Project

Profile

Help

Issue #1303

UnitPublishStep will not work with mongoengine units

Added by bmbouter over 5 years ago. Updated almost 2 years ago.

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

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:

  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.

History

#1 Updated by bmbouter over 5 years ago

  • Description updated (diff)

#2 Updated by bmbouter over 5 years ago

  • Description updated (diff)

#3 Updated by mhrivnak over 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to mhrivnak
  • Priority changed from Normal to High
  • Triaged changed from No to Yes

#4 Updated by bmbouter over 5 years ago

  • Assignee changed from mhrivnak to bmbouter

#5 Updated by mhrivnak about 5 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

#6 Updated by mhrivnak about 5 years ago

  • Platform Release set to 2.8.0

#7 Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from MODIFIED to 5

#8 Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#9 Updated by bmbouter almost 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF