foreman_scc_manager 1.8.2 → 1.8.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '090b5f9a98b9857d79b99c0206249dc632ad381f65e513da9a7fbcd5b4065e4d'
|
4
|
+
data.tar.gz: 6f099c604ebaedbda016c4b107acac1a8333516673d69976809a6329866c9f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c4e5ed794d362e22128bb90efa721e9d5539fec4854e95da82f50076e5d2fb75220da7b9b6b6175343518ca25b30ed50b4a6f3d98944d30f767af2da31423c2
|
7
|
+
data.tar.gz: 061fc929ec7698229893e16bf1873c7e3006de9647d351c64f5f69404331730f8b394759db5d922314b51f0cbb2645401d153e4dac5666d9e242b3ee4f3311a0
|
@@ -20,7 +20,9 @@ module Actions
|
|
20
20
|
input.fetch(:login),
|
21
21
|
decrypt_field(input.fetch(:password)))
|
22
22
|
output[:data] = ::SccManager.sanitize_products(products).values
|
23
|
-
rescue StandardError
|
23
|
+
rescue StandardError => e
|
24
|
+
::Foreman::Logging.logger('foreman_scc_manager').error "Error while syncronizing SCC-Products: #{e}"
|
25
|
+
output[:error] = e.to_s
|
24
26
|
output[:status] = 'FAILURE'
|
25
27
|
end
|
26
28
|
end
|
@@ -19,7 +19,9 @@ module Actions
|
|
19
19
|
input[:login],
|
20
20
|
decrypt_field(input[:password]))
|
21
21
|
output[:status] = 'SUCCESS'
|
22
|
-
rescue StandardError
|
22
|
+
rescue StandardError => e
|
23
|
+
::Foreman::Logging.logger('foreman_scc_manager').error "Error while syncronizing SCC-Repositories: #{e}"
|
24
|
+
output[:error] = e.to_s
|
23
25
|
output[:status] = 'FAILURE'
|
24
26
|
end
|
25
27
|
end
|
data/app/lib/scc_manager.rb
CHANGED
@@ -8,8 +8,8 @@ module SccManager
|
|
8
8
|
uri.scheme = URI.parse(proxy_config[:host]).scheme
|
9
9
|
uri.host = URI.parse(proxy_config[:host]).host
|
10
10
|
uri.port = proxy_config[:port].try(:to_s)
|
11
|
-
uri.user = proxy_config[:user]
|
12
|
-
uri.password = proxy_config[:password].
|
11
|
+
uri.user = proxy_config[:user]
|
12
|
+
uri.password = proxy_config[:password] if uri.user.present?
|
13
13
|
|
14
14
|
RestClient.proxy = uri.to_s
|
15
15
|
end
|
data/app/models/scc_account.rb
CHANGED
@@ -166,7 +166,8 @@ class SccAccount < ApplicationRecord
|
|
166
166
|
def test_connection
|
167
167
|
get_scc_data('/connect/organizations/subscriptions')
|
168
168
|
true
|
169
|
-
rescue StandardError
|
169
|
+
rescue StandardError => e
|
170
|
+
::Foreman::Logging.logger('foreman_scc_manager').warn "Error occurred while testing SCC-Connection to Account #{self}: #{e}"
|
170
171
|
false
|
171
172
|
end
|
172
173
|
|
@@ -185,10 +186,10 @@ class SccAccount < ApplicationRecord
|
|
185
186
|
cached_repository.save!
|
186
187
|
upstream_repo_ids << ur['id']
|
187
188
|
end
|
188
|
-
logger.debug "Found #{upstream_repo_ids.length} repositories"
|
189
|
+
::Foreman::Logging.logger('foreman_scc_manager').debug "Found #{upstream_repo_ids.length} repositories"
|
189
190
|
# delete repositories beeing removed upstream
|
190
191
|
to_delete = scc_repositories.where.not(scc_id: upstream_repo_ids)
|
191
|
-
logger.debug "Deleting #{to_delete.count} old repositories"
|
192
|
+
::Foreman::Logging.logger('foreman_scc_manager').debug "Deleting #{to_delete.count} old repositories"
|
192
193
|
to_delete.destroy_all
|
193
194
|
end
|
194
195
|
|
@@ -208,10 +209,10 @@ class SccAccount < ApplicationRecord
|
|
208
209
|
cached_product.save!
|
209
210
|
upstream_product_ids << up['id']
|
210
211
|
end
|
211
|
-
logger.debug "Found #{upstream_product_ids.length} products"
|
212
|
+
::Foreman::Logging.logger('foreman_scc_manager').debug "Found #{upstream_product_ids.length} products"
|
212
213
|
# delete products beeing removed upstream
|
213
214
|
to_delete = scc_products.where.not(scc_id: upstream_product_ids)
|
214
|
-
logger.debug "Deleting #{to_delete.count} old products"
|
215
|
+
::Foreman::Logging.logger('foreman_scc_manager').debug "Deleting #{to_delete.count} old products"
|
215
216
|
to_delete.destroy_all
|
216
217
|
# rewire product to product relationships
|
217
218
|
upstream_products.each do |up|
|
@@ -219,7 +220,7 @@ class SccAccount < ApplicationRecord
|
|
219
220
|
begin
|
220
221
|
scc_products.find_by!(scc_id: up['id']).update!(scc_extensions: extensions)
|
221
222
|
rescue ActiveRecord::RecordNotFound
|
222
|
-
logger.info "Failed to find parent scc_product '#{up['name']}'."
|
223
|
+
::Foreman::Logging.logger('foreman_scc_manager').info "Failed to find parent scc_product '#{up['name']}'."
|
223
224
|
end
|
224
225
|
end
|
225
226
|
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.
|
4
|
+
version: 1.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|