Skip to content

Commit

Permalink
Remove BaseDistribution model
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Dec 5, 2024
1 parent f7f1880 commit c7f0df2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 41 deletions.
16 changes: 16 additions & 0 deletions pulpcore/app/migrations/0126_delete_basedistribution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 4.2.16 on 2024-12-05 12:37

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("core", "0125_openpgpdistribution_openpgpkeyring_openpgppublickey_and_more"),
]

operations = [
migrations.DeleteModel(
name="BaseDistribution",
),
]
41 changes: 0 additions & 41 deletions pulpcore/app/models/publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,47 +567,6 @@ class Meta:
)


class BaseDistribution(MasterModel):
"""
A distribution defines how a publication is distributed by the Content App.
This abstract model can be used by plugin writers to create concrete distributions that are
stored in separate tables from the Distributions provided by pulpcore.
The `name` must be unique.
The ``base_path`` must have no overlapping components. So if a Distribution with ``base_path``
of ``a/path/foo`` existed, you could not make a second Distribution with a ``base_path`` of
``a/path`` or ``a`` because both are subpaths of ``a/path/foo``.
Note:
This class is no longer supported and cannot be removed from Pulp 3 due to possible
problems with old migrations for plugins. Until the migrations are squashed, this class
should be preserved.
Fields:
name (models.TextField): The name of the distribution. Examples: "rawhide" and "stable".
base_path (models.TextField): The base (relative) path component of the published url.
Relations:
content_guard (models.ForeignKey): An optional content-guard.
remote (models.ForeignKey): A remote that the content app can use to find content not
yet stored in Pulp.
"""

name = models.TextField(db_index=True, unique=True)
base_path = models.TextField(unique=True)

content_guard = models.ForeignKey(ContentGuard, null=True, on_delete=models.SET_NULL)
remote = models.ForeignKey(Remote, null=True, on_delete=models.SET_NULL)

def __init__(self, *args, **kwargs):
raise Exception(
"BaseDistribution is no longer supported. "
"Please use pulpcore.plugin.models.Distribution instead."
)


class Distribution(MasterModel):
"""
A Distribution defines how the Content App distributes a publication or repository_version.
Expand Down

0 comments on commit c7f0df2

Please sign in to comment.