Created
April 1, 2022 20:34
-
-
Save jlsherrill/7e1109953fa9cd5ca71aea53ba77d08c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Katello::ContentView.non_default.each do |cv| | |
Katello::Repository.in_default_view.each do |library_instance| | |
cv.versions.with_library_repo(library_instance).each do |version| | |
if version.archived_repos.find_by(:library_instance_id => library_instance.id).nil? | |
found = version.repositories.find_by(:library_instance_id => library_instance.id) | |
puts "#{cv.name} #{version.version}: #{library_instance.name} : env repo: #{found.id} in #{found.environment&.name}" | |
end | |
end | |
end | |
end ; nil |
It worked like charm
RHEL6 24.0: Red Hat Enterprise Linux 6 Server RPMs x86_64 6.10 : env repo: 48 in Library
This means, we have to take care of version 24.0 of RHEL6 CV.
So, in this scenario:
--> Re-synced Red Hat Enterprise Linux 6 Server RPMs x86_64 6.10 repo properly.
--> Republished a new version of RHEL6 CV and promote it to all environments.
--> Deleted version 24.0 of RHEL6 CV entirely
Re-executed the same rake script and no output this time . So processed with content migration and that issue never appeared again.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example output:
Export-Library-myfoo 2.0: test : env repo: 3 in Library
manually deleting the 'env repo' (id = 3 here), may resolve the issue