foreman_scc_manager 1.4.0 → 1.5.0
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 +4 -4
- data/README.md +1 -0
- data/app/lib/actions/scc_manager/sync_products.rb +13 -4
- data/app/lib/actions/scc_manager/sync_repositories.rb +8 -0
- data/app/lib/scc_manager.rb +11 -0
- data/app/views/scc_accounts/show.html.erb +3 -3
- data/lib/foreman_scc_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e3ad336c2287deeae7ef60de582455927e1222e3a93c260550707275e61aa84
|
4
|
+
data.tar.gz: 243b0239ce5038274c764927b6b40a5e6fe1c96d1fef33908087cb075f68f84b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8466b8453d20e881d1c8601d3ca6a3a551124d2d24675e1e959c0afdab48df174e38a43c81103f4437ec00551f3d4f9dc796347337da85c0ae340c2d56cebcb8
|
7
|
+
data.tar.gz: b50739730c156e73a36491b9bfef5f2ab0220d9e771ceaf782b49d97d1b5b6b47550fda4f03385d8ce9097664be2f526c9995513032880997aeeba70a8238cd3
|
data/README.md
CHANGED
@@ -11,6 +11,7 @@ for how to install Foreman plugins
|
|
11
11
|
|
12
12
|
| Foreman Version | Katello Version | Plugin Version |
|
13
13
|
| --------------- | --------------- | -------------- |
|
14
|
+
| 1.18 | 3.7 | ~> 1.5.0 |
|
14
15
|
| 1.17 | 3.6 | >= 1.3.1 |
|
15
16
|
| 1.16 | 3.5 | <= 1.3.0 |
|
16
17
|
| 1.15 | 3.4 | ~> 1.1.0 |
|
@@ -12,10 +12,11 @@ module Actions
|
|
12
12
|
def run
|
13
13
|
output[:status] = 'SUCCESS'
|
14
14
|
begin
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
products = ::SccManager.get_scc_data(input.fetch(:base_url),
|
16
|
+
'/connect/organizations/products',
|
17
|
+
input.fetch(:login),
|
18
|
+
input.fetch(:password))
|
19
|
+
output[:data] = ::SccManager.sanitize_products(products).values
|
19
20
|
rescue StandardError
|
20
21
|
output[:status] = 'FAILURE'
|
21
22
|
end
|
@@ -32,6 +33,14 @@ module Actions
|
|
32
33
|
def humanized_name
|
33
34
|
_('Sync SUSE subscriptions (Products)')
|
34
35
|
end
|
36
|
+
|
37
|
+
def humanized_input
|
38
|
+
input.dup.update(password: '***')
|
39
|
+
end
|
40
|
+
|
41
|
+
def humanized_output
|
42
|
+
output.dup.update(data: 'Trimmed')
|
43
|
+
end
|
35
44
|
end
|
36
45
|
end
|
37
46
|
end
|
@@ -31,6 +31,14 @@ module Actions
|
|
31
31
|
def humanized_name
|
32
32
|
_('Sync SUSE subscriptions (Repositories)')
|
33
33
|
end
|
34
|
+
|
35
|
+
def humanized_input
|
36
|
+
input.dup.update(password: '***')
|
37
|
+
end
|
38
|
+
|
39
|
+
def humanized_output
|
40
|
+
output.dup.update(data: 'Trimmed')
|
41
|
+
end
|
34
42
|
end
|
35
43
|
end
|
36
44
|
end
|
data/app/lib/scc_manager.rb
CHANGED
@@ -34,4 +34,15 @@ module SccManager
|
|
34
34
|
ensure
|
35
35
|
RestClient.proxy = ''
|
36
36
|
end
|
37
|
+
|
38
|
+
# Cope for the very weird structure of SCC output
|
39
|
+
def self.sanitize_products(products, result = {})
|
40
|
+
products.reduce(result) do |res, product|
|
41
|
+
sanitize_products(product['extensions'].tap do |extensions|
|
42
|
+
product['extensions'] = extensions.map { |extension| { 'id' => extension['id'] } }
|
43
|
+
res[product['id']] = product.merge(result.fetch(product['id'], {}))
|
44
|
+
res[product['id']]['extensions'] |= product['extensions']
|
45
|
+
end, res)
|
46
|
+
end
|
47
|
+
end
|
37
48
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% javascript 'foreman_scc_manager/scc_accounts' %>
|
2
2
|
<%= form_for([:bulk_subscribe, @scc_account], method: :put) do |f| %>
|
3
|
-
<% def render_list_node(f, scc_product, parent_id =
|
3
|
+
<% def render_list_node(f, scc_product, parent_id = "") %>
|
4
4
|
<li>
|
5
|
-
<span class="scc_product_checkbox" id="<%= "scc_product_span_#{scc_product.id}" %>" <%= "data-parent=scc_product_span_#{parent_id}" if parent_id %>>
|
5
|
+
<span class="scc_product_checkbox" id="<%= "scc_product_span_#{parent_id + "_" + scc_product.id.to_s}" %>" <%= "data-parent=scc_product_span_#{parent_id}" if parent_id != "" %>>
|
6
6
|
<% if scc_product.product %>
|
7
7
|
<%= check_box_tag("scc_account[scc_unsubscribe_product_ids][]", scc_product.id, true, disabled: true) %>
|
8
8
|
<% else %>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<% if scc_product.scc_extensions.any? %>
|
14
14
|
<ul>
|
15
15
|
<% scc_product.scc_extensions.order(:friendly_name).each do |scc_extension| %>
|
16
|
-
<% render_list_node(f, scc_extension, scc_product.id) %>
|
16
|
+
<% render_list_node(f, scc_extension, parent_id + "_" + scc_product.id.to_s) %>
|
17
17
|
<% end %>
|
18
18
|
</ul>
|
19
19
|
<% 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.
|
4
|
+
version: 1.5.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: 2018-
|
11
|
+
date: 2018-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|