Skip to content

Commit

Permalink
Merge pull request #213 from MichalHaluza/dont_remove_iso_mappings_wi…
Browse files Browse the repository at this point in the history
…thout_version

Don't remove ISOs w/o version from mappings [RHELDST-21014]
  • Loading branch information
MichalHaluza authored Oct 20, 2023
2 parents 6f26dd3 + 67f9a56 commit c68b044
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pubtools/pulplib/_impl/client/ud_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ def update_mappings_for_files(mappings, file_page):
# Returns Future[mappings] once all pages are processed.

for unit in file_page.data:
# Save all the files for which the mapping should exist
mappings.filenames_from_pulp.append(unit.path)
version = unit.version
if version:
# Add missing mappings
mappings.set_file_mapping(version, unit.path, unit.display_order)
# Save all the files for which the mapping should exist
mappings.filenames_from_pulp.append(unit.path)

if not file_page.next:
# All pages have been processed, remove mappings for files which were not listed.
Expand Down
3 changes: 1 addition & 2 deletions tests/repository/test_ud_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def test_publish_update_mappings(fast_poller, requests_mocker, client, caplog):
"name": "file3",
"size": 1,
"checksum": "cd293be6cea034bd45a0352775a219ef5dc7825ce55d1f7dae9762d80ce64411",
"pulp_user_metadata": {"version": "3.0"},
}
},
]
Expand Down Expand Up @@ -169,7 +168,7 @@ def test_publish_update_mappings(fast_poller, requests_mocker, client, caplog):
{"filename": "file5", "order": 4.5},
],
# This wasn't touched because, although the repo has the file, it has no
# defined order
# defined version or order
"3.0": [{"filename": "file3", "order": 1234}],
# This was updated
"4.0": [{"filename": "file4", "order": -2.0}],
Expand Down

0 comments on commit c68b044

Please sign in to comment.