Skip to content

Commit

Permalink
Remove unused field Remote.validate
Browse files Browse the repository at this point in the history
This field was intended for plugin use, but so far plugins validate
unconditionally. For now, we remove the field from core but plugins can
add it on their own if they have a use for it.

https://pulp.plan.io/issues/4714
fixes #4714
  • Loading branch information
asmacdo committed Jun 28, 2019
1 parent 59f3450 commit 9e6e5d3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
17 changes: 17 additions & 0 deletions pulpcore/app/migrations/0003_remove_remote_validate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.2.2 on 2019-06-27 20:20

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0002_contentappstatus'),
]

operations = [
migrations.RemoveField(
model_name='remote',
name='validate',
),
]
2 changes: 0 additions & 2 deletions pulpcore/app/models/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class Remote(MasterModel):
name (models.CharField): The remote name.
url (models.TextField): The URL of an external content source.
validate (models.BooleanField): If True, the plugin will validate imported files.
ssl_ca_certificate (models.FileField): A PEM encoded CA certificate used to validate the
server certificate presented by the external source.
ssl_client_certificate (models.FileField): A PEM encoded client certificate used
Expand Down Expand Up @@ -97,7 +96,6 @@ class Remote(MasterModel):
name = models.CharField(db_index=True, unique=True, max_length=255)

url = models.TextField()
validate = models.BooleanField(default=True)

ssl_ca_certificate = models.TextField(null=True)
ssl_client_certificate = models.TextField(null=True)
Expand Down
11 changes: 4 additions & 7 deletions pulpcore/app/serializers/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ class RemoteSerializer(MasterModelSerializer):
url = serializers.CharField(
help_text='The URL of an external content source.',
)
validate = serializers.BooleanField(
help_text='If True, the plugin will validate imported artifacts.',
required=False,
)
ssl_ca_certificate = SecretCharField(
help_text='A string containing the PEM encoded CA certificate used to validate the server '
'certificate presented by the remote server. All new line characters must be '
Expand Down Expand Up @@ -122,9 +118,10 @@ class Meta:
abstract = True
model = models.Remote
fields = MasterModelSerializer.Meta.fields + (
'name', 'url', 'validate', 'ssl_ca_certificate', 'ssl_client_certificate',
'ssl_client_key', 'ssl_validation', 'proxy_url', 'username', 'password',
'_last_updated', 'download_concurrency', 'policy')
'name', 'url', 'ssl_ca_certificate', 'ssl_client_certificate', 'ssl_client_key',
'ssl_validation', 'proxy_url', 'username', 'password', '_last_updated',
'download_concurrency', 'policy'
)


class RepositorySyncURLSerializer(serializers.Serializer):
Expand Down

0 comments on commit 9e6e5d3

Please sign in to comment.