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

Also available in: Atom PDF