forked from Katello/katello
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #37131 - Migrate all organizations to SCA (Katello#10875)
* Fixes #37131 - Migrate all organizations to SCA - Add upgrade rake task to migrate all organizations to SCA on upgrade - Add dry run option to rake task - Update content access mode list for all orgs so that entitlement mode is not allowed * Refs #37131 - rerecord VCRs
- Loading branch information
1 parent
da4a68d
commit 16cbea2
Showing
15 changed files
with
3,034 additions
and
2,767 deletions.
There are no files selected for viewing
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
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
35 changes: 35 additions & 0 deletions
35
lib/katello/tasks/upgrades/4.12/update_content_access_modes.rake
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace :katello do | ||
namespace :upgrades do | ||
namespace '4.12' do | ||
desc "Update content access modes for all organizations" | ||
task :update_content_access_modes, [:commit] => ["environment"] do |_t, args| | ||
# make sure Candlepin is running | ||
print "Checking Candlepin status\n" | ||
Katello::Ping.ping!(services: [:candlepin]) | ||
|
||
# To run without committing changes, use: | ||
# foreman-rake katello:upgrades:4.12:update_content_access_modes[dry_run] | ||
commit = !(args[:commit].to_s == 'dry_run') | ||
msg_word = commit ? "Setting" : "Checking" | ||
print "#{msg_word} content access modes\n" | ||
migrated_orgs_count = 0 | ||
Organization.all.each do |org| | ||
next if org.simple_content_access? | ||
|
||
print "#{msg_word} content access mode for #{org.name}\n" | ||
migrated_orgs_count += 1 | ||
if commit | ||
::Katello::Resources::Candlepin::Owner.update(org.label, contentAccessMode: 'org_environment') | ||
end | ||
end | ||
print "----------------------------------------\n" | ||
if commit | ||
print "Set content access mode for #{migrated_orgs_count} organizations\n" | ||
else | ||
print "#{migrated_orgs_count} organizations would be migrated to Simple Content Access on upgrade\n" | ||
end | ||
print "----------------------------------------\n" | ||
end | ||
end | ||
end | ||
end |
358 changes: 177 additions & 181 deletions
358
test/fixtures/vcr_cassettes/katello/certs/verify_ueber_cert_changes.yml
Large diffs are not rendered by default.
Oops, something went wrong.
399 changes: 197 additions & 202 deletions
399
test/fixtures/vcr_cassettes/katello/certs/verify_ueber_cert_no_change.yml
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.