Project

Profile

Help

Story #7696

As a plugin developer, I have the Artifacts checked at pre-save time against the ALLOWED_CONTENT_CHECKSUMS instead of at __init__

Added by bmbouter 8 days ago. Updated 6 days ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Quarter:

Description

Background

Right now the Artifact.init checks to see if checksums that are not allowed are being used and raises an error. That happens here.

This is has a problem when plugin code (like in pulp_rpm for example) does this:

foo = Artifact()
foo.md5 = 'somemd5string'
foo.save()

Improvement

Move the checking currently in Artifact.__init__ to a Artifact.pre_save hook using django-lifecycle.

Alternative

Add a property to each of the checksums on Artifact that checks if it was set post construction by init. This keeps the check in two places and it's more code to carry/maintain. These downsides make it the alternative.


Related issues

Related to Pulp - Story #5216: As a user, I can configure which checksum types I want to use in PulpCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by daviddavis 8 days ago

  • Related to Story #5216: As a user, I can configure which checksum types I want to use in Pulp added

#2 Updated by daviddavis 8 days ago

  • Groomed changed from No to Yes
  • Sprint Candidate changed from No to Yes

Please register to edit this issue

Also available in: Atom PDF