Task #8522
closedEnsure compatibility with Distribution changes in pulpcore 3.12
100%
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'))
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
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.
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
Updated by ggainey over 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ggainey
- Sprint set to Sprint 98
Updated by ggainey over 3 years ago
- Status changed from ASSIGNED to POST
Added by ggainey over 3 years ago
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]
Updated by ggainey over 3 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulp:pulp-2to3-migration|dda7d29571a8284f6572795f53a342ff1ff4abf0.
Updated by pulpbot over 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Code changes for pulpcore-3.13 compatibility.
enqueue_with_reservation() -> dispatch() BaseDistribution -> Distribution
closes #8522 [nocoverage]