Bug #34992
closedContent import fails if repo labels differ and repo is already imported
Description
Description of problem:
When repository labels between exporting and importing satellites don't match, the import process will fail with a conflict error if the repository being imported is already enabled (due to a previous import).
Version-Release number of selected component (if applicable):
This issue only happens on Satellite 6.10.5+
How reproducible:
Always
Steps to Reproduce:
1. Ensure the exporting and importing Satellite has a mismatch in the label of a repository
2. Export the repository on exporting server
3. Import the repository on importing server
4. Export a version 2.0 of the repository (incremental or complete, doesn't matter)
5. Try importing version 2.0
Actual results:
Import of version 2.0 fails with a conflict:
~~
hammer content-import library --path /var/lib/pulp/imports/Org/Export-Library/2.0/2022-05-31T09-56-09-04-00/ --organization-id 1
Could not import the archive.:
Error: 409 Conflict
~~
Logs show a stacktrace like this:
~~
2022-05-31T10:08:47 [E|app|a6c5fda2] Katello::Errors::ConflictException: The repository is already enabled
a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/lib/actions/katello/repository_set/enable_repository.rb:15:in `plan'
a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/action.rb:515:in `block (3 levels) in execute_plan'
a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware/stack.rb:27:in `pass'
a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware.rb:19:in `pass'
a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware.rb:36:in `plan'
a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware/stack.rb:23:in `call'
a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware/stack.rb:27:in `pass'
~~
Expected results:
Import should work and update the existing repository, instead of trying to enable it again
Additional info: