foreman_scc_manager 1.5.1 → 1.6.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a29f70bc667b2d96113d1852e32f0eb58acabb875ec0c8285008e058ee67d43
|
4
|
+
data.tar.gz: 80db612f6a5aef4dcd1bdaf707f8a8cb6f5c60abf68066b2254a80d323c7a189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e440f952a3259ac4875b93f463ce338fd8932dfc71bd001d66dea2e5ec60022974a0547143101b0be306db168a5db48dd4b8e7d1c34a7a3ba58a7c0f9f3d6b87
|
7
|
+
data.tar.gz: 49c2168e1c593f18f227e7cad45d097330b5f52e35b45a94351f81fc750a6b6d237fecb55df0307fa76db48374696a9639c496bb30858e5b450f37be01b90666
|
data/README.md
CHANGED
@@ -11,7 +11,8 @@ for how to install Foreman plugins
|
|
11
11
|
|
12
12
|
| Foreman Version | Katello Version | Plugin Version |
|
13
13
|
| --------------- | --------------- | -------------- |
|
14
|
-
| 1.
|
14
|
+
| 1.21 | 3.10 | ~> 1.6.0 |
|
15
|
+
| 1.20 | 3.9 | ~> 1.6.0 |
|
15
16
|
| 1.19 | 3.8 | ~> 1.5.1 |
|
16
17
|
| 1.18 | 3.7 | ~> 1.5.0 |
|
17
18
|
| 1.17 | 3.6 | >= 1.3.1 |
|
@@ -63,7 +63,7 @@ class SccAccountsController < ApplicationController
|
|
63
63
|
def sync
|
64
64
|
sync_task = ForemanTasks.async_task(::Actions::SccManager::Sync, @scc_account)
|
65
65
|
@scc_account.update! sync_task: sync_task
|
66
|
-
|
66
|
+
success _('Sync task started.')
|
67
67
|
rescue ::Foreman::Exception => e
|
68
68
|
error _('Failed to add task to queue: %s') % e.to_s
|
69
69
|
rescue ForemanTasks::Lock::LockConflict => e
|
@@ -80,9 +80,9 @@ class SccAccountsController < ApplicationController
|
|
80
80
|
ForemanTasks.async_task(::Actions::BulkAction,
|
81
81
|
::Actions::SccManager::SubscribeProduct,
|
82
82
|
scc_products_to_subscribe)
|
83
|
-
|
83
|
+
success _('Task to subscribe products started.')
|
84
84
|
else
|
85
|
-
|
85
|
+
warning _('No products selected.')
|
86
86
|
end
|
87
87
|
rescue ::Foreman::Exception => e
|
88
88
|
error _('Failed to add task to queue: %s') % e.to_s
|
@@ -72,7 +72,7 @@ module Actions
|
|
72
72
|
repository = product.add_repo(repo_param)
|
73
73
|
repository.mirror_on_sync = true
|
74
74
|
repository.verify_ssl_on_sync = true
|
75
|
-
trigger(::Actions::Katello::Repository::
|
75
|
+
trigger(::Actions::Katello::Repository::CreateRoot, repository)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
data/app/models/scc_product.rb
CHANGED
@@ -32,7 +32,7 @@ class SccProduct < ApplicationRecord
|
|
32
32
|
ForemanTasks.sync_task(::Actions::Katello::Product::Create, new_product, scc_account.organization)
|
33
33
|
new_product.reload
|
34
34
|
scc_repositories.each do |repo|
|
35
|
-
uniq_repo_name =
|
35
|
+
uniq_repo_name = repo.uniq_name(self)
|
36
36
|
label = Katello::Util::Model.labelize(uniq_repo_name)
|
37
37
|
unprotected = true
|
38
38
|
gpg_key = new_product.gpg_key
|
@@ -11,11 +11,15 @@ class SccRepository < ApplicationRecord
|
|
11
11
|
token.blank? ? url : url + '?' + token
|
12
12
|
end
|
13
13
|
|
14
|
+
def uniq_name(scc_product)
|
15
|
+
scc_product.uniq_name + ' ' + description
|
16
|
+
end
|
17
|
+
|
14
18
|
def token_changed_callback
|
15
19
|
User.current ||= User.anonymous_admin
|
16
20
|
scc_products.where.not(product: nil).find_each do |sp|
|
17
|
-
reponame = sp
|
18
|
-
repository = sp.product.
|
21
|
+
reponame = uniq_name(sp)
|
22
|
+
repository = sp.product.root_repositories.find_by(name: reponame)
|
19
23
|
unless repository.url == full_url
|
20
24
|
::Foreman::Logging.logger('foreman_scc_manager').info "Update URL-token for repository '#{reponame}'."
|
21
25
|
ForemanTasks.async_task(::Actions::Katello::Repository::Update, repository, url: full_url)
|
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.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|