Project

Profile

Help

Issue #2076

distributor update fails trying to remove already-missing key

Added by mhrivnak over 5 years ago. Updated almost 3 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.8.5
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Sprint 13
Quarter:

Description

When a client wants to update a distributor config, they can remove a setting entirely from the config by passing a value of "None" as the value in the update call. This is documented in the REST API docs. Pulp sees the value of None and removes the corresponding key from the distributor's config.

But it assumes that key is present. If it is not, an unhandled KeyError exception occurs.

https://github.com/pulp/pulp/blob/pulp-2.8.5-1/server/pulp/server/controllers/distributor.py#L211

That line of code makes the assumption. The bug could be fixed by giving "pop()" a default value as the second argument.


Related issues

Is duplicate of RPM Support - Issue #2134: Updating a repo without specifying checksum_type causes KeyErrorCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by amacdona@redhat.com over 5 years ago

  • Triaged changed from No to Yes
  • Tags Easy Fix added

#2 Updated by ipanova@redhat.com about 5 years ago

  • Sprint/Milestone set to 31

#4 Updated by ipanova@redhat.com about 5 years ago

  • Is duplicate of Issue #2134: Updating a repo without specifying checksum_type causes KeyError added

#6 Updated by ipanova@redhat.com about 5 years ago

  • Status changed from NEW to CLOSED - DUPLICATE

#8 Updated by bmbouter almost 4 years ago

  • Sprint set to Sprint 13

#9 Updated by bmbouter almost 4 years ago

  • Sprint/Milestone deleted (31)

#10 Updated by bmbouter almost 3 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF