From 323bb045b136334e4debac7c0ec9a6c0906166e2 Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Tue, 30 Jan 2024 20:15:17 -0500 Subject: [PATCH] Make relative_path a no-op Setting the relative_path during package upload is a highway straight to bad places. Users can set multiple packages to foo.rpm (or equivalent) provide names to packages that don't match their metadata and so forth. [noissue] --- pulp_rpm/app/serializers/package.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pulp_rpm/app/serializers/package.py b/pulp_rpm/app/serializers/package.py index 36ae113d37..723e272950 100644 --- a/pulp_rpm/app/serializers/package.py +++ b/pulp_rpm/app/serializers/package.py @@ -262,11 +262,8 @@ def deferred_validate(self, data): ) + ".rpm" ) - if not data.get("relative_path"): - data["relative_path"] = filename - new_pkg["location_href"] = filename - else: - new_pkg["location_href"] = data["relative_path"] + data["relative_path"] = filename + new_pkg["location_href"] = filename data.update(new_pkg) return data