Project

Profile

Help

Issue #2076

closed

distributor update fails trying to remove already-missing key

Added by mhrivnak almost 8 years ago. Updated about 5 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 - CURRENTRELEASEfdobrovoActions
Actions #1

Updated by amacdona@redhat.com almost 8 years ago

  • Triaged changed from No to Yes
  • Tags Easy Fix added
Actions #2

Updated by ipanova@redhat.com over 7 years ago

  • Sprint/Milestone set to 31
Actions #4

Updated by ipanova@redhat.com over 7 years ago

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

Updated by ipanova@redhat.com over 7 years ago

  • Status changed from NEW to CLOSED - DUPLICATE
Actions #8

Updated by bmbouter about 6 years ago

  • Sprint set to Sprint 13
Actions #9

Updated by bmbouter about 6 years ago

  • Sprint/Milestone deleted (31)
Actions #10

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF