Project

Profile

Help

Task #8522

closed

Ensure compatibility with Distribution changes in pulpcore 3.12

Added by ttereshc over 3 years ago. Updated over 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 98
Quarter:

Description

Pulpcore 3.12 introduced new class Distribution and it deprecates the BaseDsitribution class.
Pulp content plugins will adjust to that change at some point before pulpcore 3.13 is out.

Pulp 2to3 migration needs to do it as well. It uses 1to1 relatioship to BaseDistribution here.

Other requirements are:

  • migration plugin data migration can only be run after all the supported plugins have been migrated to using new Distribution class.
  • all content plugins are optional, so we can not require unconditionally to have certain versions of content plugins being installed or their migration being run.

Consider this Django approach to meet the requirement above. Taken from the Django docs:

    if global_apps.is_installed('old_app'):
        dependencies.append(('old_app', '0001_initial'))
Actions #1

Updated by dalley over 3 years ago

tteresch, FYI

<dalley> ttereshc, I remember one of the issues I had when I was trying this approach out
<dalley> apparently the way app loading is done in django 2.2, the global_apps.is_installed() doesn't use the same "name" as other mechanisms. you have to put like pulp_file.app or something instead of just "file"
<dalley> I got the impression that it's unintended but not normally a problem unless you're doing weird things with app loading like we are
Actions #2

Updated by ipanova@redhat.com over 3 years ago

Out[7]: <Pulp2Distributor: pk=d91be2a8-607c-470c-9d10-452dd14ee99d>
pulp2dist[0].pulp3_distribution
distribution
Out[9]: <FileDistribution: 60885969415f6e243c5f8359-pupsik>
pulp2dist[0].pulp3_distribution=distribution
Traceback (most recent call last):
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/IPython/core/interactiveshell.py", line 3343, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-10-dba9d8b472f6>", line 1, in <module>
    pulp2dist[0].pulp3_distribution=distribution
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/fields/related_descriptors.py", line 301, in __set__
    super().__set__(instance, value)
  File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/fields/related_descriptors.py", line 211, in __set__
    self.field.remote_field.model._meta.object_name,
ValueError: Cannot assign "<FileDistribution: 60885969415f6e243c5f8359-pupsik>": "Pulp2Distributor.pulp3_distribution" must be a "BaseDistribution" instance.

This is what i have spotted with the debugger during the migration.

Actions #3

Updated by ipanova@redhat.com over 3 years ago

in addition these changes need to be applied https://github.com/pulp/pulp-2to3-migration/pull/355/files

Actions #4

Updated by ggainey over 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ggainey
  • Sprint set to Sprint 98
Actions #5

Updated by ggainey over 3 years ago

  • Status changed from ASSIGNED to POST

Added by ggainey over 3 years ago

Revision dda7d295 | View on GitHub

Code changes for pulpcore-3.13 compatibility.

enqueue_with_reservation() -> dispatch() BaseDistribution -> Distribution

closes #8522 [nocoverage]

Added by ggainey over 3 years ago

Revision dda7d295 | View on GitHub

Code changes for pulpcore-3.13 compatibility.

enqueue_with_reservation() -> dispatch() BaseDistribution -> Distribution

closes #8522 [nocoverage]

Added by ggainey over 3 years ago

Revision dda7d295 | View on GitHub

Code changes for pulpcore-3.13 compatibility.

enqueue_with_reservation() -> dispatch() BaseDistribution -> Distribution

closes #8522 [nocoverage]

Actions #6

Updated by ggainey over 3 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #7

Updated by pulpbot over 3 years ago

  • Sprint/Milestone set to 0.12.0
Actions #8

Updated by pulpbot over 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF