foreman_scc_manager 1.8.17 → 1.8.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96a0d125c5dab16617adfbfbabb28166111f8d0f85c5cbac77836e2f2d6a6791
4
- data.tar.gz: 2b3ea8baa9f5f09427aee36ce034f6d4e0c385c395b148311ce1605221d9843d
3
+ metadata.gz: 6f77d244f737115eb2552b190ea4254a2174f46f71ee143996f5bc48f1eb3280
4
+ data.tar.gz: 8145e4a47459a01adc9f4ea1c737e7ffae351d8fd2120be41317f793ce5bce0a
5
5
  SHA512:
6
- metadata.gz: 193d57d91538c74f8e29ee1d7fce65153c46a286b586a281674cbfcde51e833a485c8c7bab8e4342ab09451bcc044dceb09be42e489f3ed3ef4a91217b2b5585
7
- data.tar.gz: 76f4ff19c508a4f61d5153dcf80f1298c9edb140c0e59e05f702218d097b4d62fe9f7f945dd797bbe0c4ad495db2a39b0807cd7006a7d20f2f8994616feb9da7
6
+ metadata.gz: 104e4dfe92004751c3a74b2fa4e06e134ec053a84cbd960ad025dd46504a4b3a5bb36c2fc5e00da381b7d247b1039c99be661c4a7e76f9bc2d38055927d75fa9
7
+ data.tar.gz: 1b0f1f14f32533461071e68ba485639d9a377413121586b93f8f7ede4388caf935aeeb9a7e3135f058d74390a7f1a6ff92f642f3ef0dea7c7dd9bada61a9060d
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ForemanSccManager
2
- VERSION = '1.8.17'.freeze
2
+ VERSION = '1.8.18'.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.17
4
+ version: 1.8.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - ATIX AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-01 00:00:00.000000000 Z
11
+ date: 2022-04-22 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