foreman_scc_manager 1.8.16 → 1.8.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd540b3e5ecde9d0174c474698db985365681fc85eede30117eb2663f51f2158
4
- data.tar.gz: 9a44579a7948089c9a708dee17f6ac7d7805c68d995feeaf6f5a3e46babda35b
3
+ metadata.gz: 94924eef8de5143907ca81d9ea6c41915d51c931d394356497e7168b8ffbe09e
4
+ data.tar.gz: 49d822f0d3c70abd53a0d818c3dc7c2102c9e12e8c325a3580f9e966bf50dd61
5
5
  SHA512:
6
- metadata.gz: 1b6c6e4a370f1e8a2d133a6891ba5b4493ecab019e4d32df920be9cfacc220ff86bcf69080c57c073d07015d916065260999ff9cc2e01ea2542947bfad400dcf
7
- data.tar.gz: 5f6afa5a1e2899643779855270b38a31df1d6a4bc2ba49ddc3643529add32ad8b4129a642aa570f4498a847ccdc90c21b0ad7c22497e8e6328dc5037de5724a7
6
+ metadata.gz: c26c8d840bd3a97a3cbc99e84dc53bc17c48a8175dd026cfd618d5597cbf934373ed048c978e5805db1942ef0b3b4ef9283ee60b8e36b26e5d3a886e48f20067
7
+ data.tar.gz: 6599cad1358b63afba7824ca2d8f7328d30c8f2d851814b681be2b7ec4de42116e9e3160680cd814f960cb49b65fd09edda863a7383e5fabd93925791bd6600e
@@ -84,9 +84,13 @@ module Actions
84
84
  :unprotected => unprotected,
85
85
  :gpg_key => gpg_key,
86
86
  :arch => input[:arch],
87
- :download_policy => ::Runcible::Models::YumImporter::DOWNLOAD_IMMEDIATE }
87
+ :download_policy => Setting[:default_download_policy] }
88
88
  repository = product.add_repo(repo_param)
89
- repository.mirror_on_sync = true
89
+ if repository.has_attribute?('mirror_on_sync')
90
+ repository.mirror_on_sync = true
91
+ else
92
+ repository.mirroring_policy = ::Katello::RootRepository::MIRRORING_POLICY_CONTENT
93
+ end
90
94
  repository.verify_ssl_on_sync = true
91
95
  trigger(::Actions::Katello::Repository::CreateRoot, repository).tap do
92
96
  output[:katello_root_repository_id] = repository.id
@@ -58,7 +58,11 @@ class SccProduct < ApplicationRecord
58
58
  gpg_key = new_product.gpg_key
59
59
  new_repo = new_product.add_repo(label, uniq_repo_name, repo.full_url, 'yum', unprotected, gpg_key)
60
60
  new_repo.arch = arch || 'noarch'
61
- new_repo.mirror_on_sync = true
61
+ if new_repo.has_attribute?('mirror_on_sync')
62
+ new_repo.mirror_on_sync = true
63
+ else
64
+ new_repo.mirroring_policy = ::Katello::RootRepository::MIRRORING_POLICY_CONTENT
65
+ end
62
66
  new_repo.verify_ssl_on_sync = true
63
67
  ForemanTasks.sync_task(::Actions::Katello::Repository::Create, new_repo, false, false)
64
68
  end
@@ -22,10 +22,15 @@ class SccRepository < ApplicationRecord
22
22
 
23
23
  def token_changed_callback
24
24
  User.current ||= User.anonymous_admin
25
- repo = self.katello_root_repository
26
- return if repo.nil? || repo.url == full_url
27
25
 
28
- ::Foreman::Logging.logger('foreman_scc_manager').info "Update URL-token for repository '#{repo.name}'."
29
- ForemanTasks.async_task(::Actions::Katello::Repository::Update, repo, url: full_url)
26
+ # get all Katello repos that were derived from this SCC repo
27
+ # as uniq_name was changed, we need to look for repo labels that end with the repo name
28
+ katello_repos = Katello::RootRepository.where('label like ?', "%#{::Katello::Util::Model.labelize(self.description)}%")
29
+ katello_repos.each do |repo|
30
+ unless repo.url == full_url
31
+ ::Foreman::Logging.logger('foreman_scc_manager').info "Update URL-token for repository '#{repo.name}'."
32
+ ForemanTasks.async_task(::Actions::Katello::Repository::Update, repo, url: full_url)
33
+ end
34
+ end
30
35
  end
31
36
  end
@@ -25,7 +25,7 @@
25
25
  display_link_if_authorized(_("Sync"), hash_for_sync_scc_account_path(:id => scc_account).merge(:auth_object => scc_account, :authorizer => authorizer),
26
26
  :method => :put),
27
27
  display_delete_if_authorized(hash_for_scc_account_path(:id => scc_account).merge(:auth_object => scc_account, :authorizer => authorizer, :permission => 'delete_scc_accounts'),
28
- :data => { :confirm => _("Delete %s?") % scc_account.to_s })
28
+ :data => { :confirm => _("WARNING: If you want to switch SCC accounts and retain the synchronized content, DO NOT delete your old SCC account, even if it is expired. Please change the login and password of your SCC account, instead.\n\nIf you delete your old SCC account, you CANNOT reuse existing repositories, products, content views, and composite content views.\n\nReally delete SCC account %s?") % scc_account.to_s })
29
29
 
30
30
  ) %>
31
31
  </td>
@@ -1,3 +1,3 @@
1
1
  module ForemanSccManager
2
- VERSION = '1.8.16'.freeze
2
+ VERSION = '1.8.19'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_scc_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.16
4
+ version: 1.8.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - ATIX AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-08 00:00:00.000000000 Z
11
+ date: 2022-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -220,21 +220,21 @@ signing_key:
220
220
  specification_version: 4
221
221
  summary: Suse Customer Center plugin for Foreman
222
222
  test_files:
223
+ - test/support/fixtures_support.rb
223
224
  - test/unit/foreman_scc_manager_test.rb
224
- - test/features/sync_test.rb
225
+ - test/actions/sync_test.rb
226
+ - test/test_plugin_helper.rb
227
+ - test/factories/foreman_scc_manager_factories.rb
225
228
  - test/models/scc_product_test.rb
226
229
  - test/models/scc_account_test.rb
227
- - test/factories/foreman_scc_manager_factories.rb
228
- - test/controllers/api/v2/scc_accounts_test.rb
229
- - test/controllers/api/v2/scc_products_test.rb
230
- - test/controllers/scc_accounts_controller_test.rb
231
- - test/actions/sync_test.rb
232
- - test/support/fixtures_support.rb
233
- - test/fixtures/models/scc_accounts.yml
230
+ - test/features/sync_test.rb
234
231
  - test/fixtures/models/scc_repositories.yml
232
+ - test/fixtures/models/scc_accounts.yml
235
233
  - test/fixtures/models/scc_products.yml
236
- - test/fixtures/files/data_products_page2.json
237
234
  - test/fixtures/files/data_products_page1.json
238
235
  - test/fixtures/files/data_subscriptions.json
236
+ - test/fixtures/files/data_products_page2.json
239
237
  - test/fixtures/files/data_repositories.json
240
- - test/test_plugin_helper.rb
238
+ - test/controllers/scc_accounts_controller_test.rb
239
+ - test/controllers/api/v2/scc_products_test.rb
240
+ - test/controllers/api/v2/scc_accounts_test.rb