Project

Profile

Help

Issue #1042

closed

Exception raised when building error message on relative_url collision

Added by bcourt over 7 years ago. Updated almost 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.6.1
Platform Release:
2.6.5
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

Description

If a repo is created using a relative_url

The line https://github.com/pulp/pulp_rpm/blob/pulp-rpm-2.6.1-1/plugins/pulp_rpm/plugins/distributors/yum/configuration.py#L469
is checking which will raise a KeyError if 'relative_url' has not been defined in the distributor config.

conflicting_relative_url = distributor['config']['relative_url'] or conflicting_repo_id

This should be replaced with something like

if 'relative_url' in distributor['config']:
    conflicting_relative_url = distributor['config']['relative_url'] or conflicting_repo_id
else:
    conflicting_relative_url = conflicting_repo_id

Also available in: Atom PDF