foreman_scc_manager 1.4.0 → 1.5.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: 67a2884348925699e2aadc5796abe4ec48adee8458c577c035c564c1fbd9f950
4
- data.tar.gz: 2ea193e0dbc07d41706f908870c610e1411ec200df1c6f10435f8ddc2dde0a4f
3
+ metadata.gz: 3e3ad336c2287deeae7ef60de582455927e1222e3a93c260550707275e61aa84
4
+ data.tar.gz: 243b0239ce5038274c764927b6b40a5e6fe1c96d1fef33908087cb075f68f84b
5
5
  SHA512:
6
- metadata.gz: cbac716765fccb60766e4e3a6a205d596bbfd08b1349efe1e9ed56a70bb84696835895520d2b93c6bf079f8ae9d0aebab169d541b5d6291f9519f24347b407c9
7
- data.tar.gz: 6419f3962cc8355300132eb6ea01719e5a912a66f18051922e2edc8db482a0d46d224f88bd6c5dbef501c06b877dbe6dc44cfc4e48d4438e62251c46cf6599c3
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
- output[:data] = ::SccManager.get_scc_data(input.fetch(:base_url),
16
- '/connect/organizations/products',
17
- input.fetch(:login),
18
- input.fetch(:password))
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
@@ -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 = nil) %>
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 %>
@@ -1,3 +1,3 @@
1
1
  module ForemanSccManager
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.5.0'.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.4.0
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-08-07 00:00:00.000000000 Z
11
+ date: 2018-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc