Task #8522
closed
Ensure compatibility with Distribution changes in pulpcore 3.12
Status:
CLOSED - CURRENTRELEASE
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'))
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
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.
- Status changed from NEW to ASSIGNED
- Assignee set to ggainey
- Sprint set to Sprint 98
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
- Sprint/Milestone set to 0.12.0
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Code changes for pulpcore-3.13 compatibility.
enqueue_with_reservation() -> dispatch() BaseDistribution -> Distribution
closes #8522 [nocoverage]