foreman_rh_cloud 4.0.31 → 4.0.32

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: e14db9e6999496bcfba315a4cd476131e102c9694b479f8208938f021633c132
4
- data.tar.gz: 74742e367059aa5b6e68aaae1eaf16a0de2f9df9e981215a070768654517e51b
3
+ metadata.gz: b11e8e007c7d982a5554b027916d26df635d1d3824ba8a586b794370f1828f1a
4
+ data.tar.gz: ac439b33efec89c1f939745de5470d8bcb12c9cc21dd8464527ecd400d9fe0a0
5
5
  SHA512:
6
- metadata.gz: f89a0c377c341f85b3568e47a7939233c6ab0ad6b4455ea7774b8d4a1359da1b34b718b2e96d00ae30577e350aafd130e052cee73100094672e69764137d3022
7
- data.tar.gz: 79969dfbae771637006974db3663d8d86804d4cb2b6056bbacbdaeb21b8d72ee15c34654ade1c0efa14aa6b955973f9ce33401b6ab8bafbcf764cc30882f6a76
6
+ metadata.gz: 05a8f783d13985048ec24dd4d9fe8037cb1a5d8af0b266739fbbc515c9542f2b9c14de8e6e2b209194f84c8b5902300ff6f0b746814a063e0ab45521d8139035
7
+ data.tar.gz: 632d536fa1056cc8fd69ee7375f7683da2675756151f890a3a6d1e42081225cbde5e71c8b3516e0804eabcda54ac61b340ae622f0f7cc63ebc0f4fc15026c809
@@ -39,6 +39,9 @@ module ForemanRhCloud
39
39
  certs = candlepin_id_cert(@org)
40
40
  return StandardError.new('certificate missing') unless certs
41
41
 
42
+ cert_checker = Katello::UpstreamConnectionChecker.new(@org)
43
+ cert_checker.assert_connection
44
+
42
45
  execute_cloud_request(
43
46
  method: :get,
44
47
  url: ForemanRhCloud.cert_base_url + "/api/apicast-tests/ping",
@@ -72,7 +75,7 @@ module ForemanRhCloud
72
75
  org,
73
76
  {
74
77
  success: cert_response.is_a?(RestClient::Response),
75
- error: (cert_response.is_a?(Exception) ? cert_response.inspect : nil),
78
+ error: (cert_response.is_a?(Exception) ? cert_response&.message || cert_response.inspect : nil),
76
79
  },
77
80
  ]
78
81
  end
@@ -104,7 +104,9 @@ module ForemanInventoryUpload
104
104
  end
105
105
 
106
106
  def obfuscate_ip(ip, ips_dict)
107
- "10.230.230.#{ips_dict.count + 1}"
107
+ max_obfuscated = ips_dict.values.map { |v| IPAddr.new(v).to_i }.max || IPAddr.new('10.230.230.0').to_i
108
+
109
+ IPAddr.new(max_obfuscated + 1, Socket::AF_INET).to_s
108
110
  end
109
111
 
110
112
  def bios_uuid(host)
@@ -1,3 +1,3 @@
1
1
  module ForemanRhCloud
2
- VERSION = '4.0.31'.freeze
2
+ VERSION = '4.0.32'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "4.0.31",
3
+ "version": "4.0.32",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,6 +29,8 @@ class CloudStatusControllerTest < ActionController::TestCase
29
29
  RestClient::Response.new('TEST RESPONSE ORG 1')
30
30
  )
31
31
 
32
+ Katello::UpstreamConnectionChecker.any_instance.expects(:assert_connection).twice.returns(true)
33
+
32
34
  get :index, session: set_session_user
33
35
 
34
36
  assert_response :success
@@ -30,13 +30,13 @@ class FactHelpersTest < ActiveSupport::TestCase
30
30
  test 'obfuscates ips with insights-client data' do
31
31
  host = mock('host')
32
32
  @instance.expects(:fact_value).with(host, 'insights_client::ips').returns(
33
- '[{"obfuscated": "10.230.230.1", "original": "224.0.0.1"}, {"obfuscated": "10.230.230.2", "original": "224.0.0.251"}]'
33
+ '[{"obfuscated": "10.230.230.1", "original": "224.0.0.1"}, {"obfuscated": "10.230.230.255", "original": "224.0.0.251"}]'
34
34
  )
35
35
 
36
36
  actual = @instance.obfuscated_ips(host)
37
37
 
38
38
  assert_equal '10.230.230.1', actual['224.0.0.1']
39
- assert_equal '10.230.230.3', actual['224.0.0.2']
39
+ assert_equal '10.230.231.0', actual['224.0.0.2']
40
40
  end
41
41
 
42
42
  test 'obfuscates ips without insights-client data' do
@@ -28,6 +28,8 @@ class CloudStatusServiceTest < ActiveSupport::TestCase
28
28
  RestClient::Response.new('TEST RESPONSE ORG 1')
29
29
  )
30
30
 
31
+ Katello::UpstreamConnectionChecker.any_instance.expects(:assert_connection).twice.returns(true)
32
+
31
33
  service = ForemanRhCloud::CloudPingService.new(organizations, nil)
32
34
  actual = service.ping
33
35
 
@@ -55,6 +57,8 @@ class CloudStatusServiceTest < ActiveSupport::TestCase
55
57
  'TEST RESPONSE ORG 0'
56
58
  )
57
59
 
60
+ Katello::UpstreamConnectionChecker.any_instance.expects(:assert_connection).returns(true)
61
+
58
62
  service = ForemanRhCloud::CloudPingService.new(organizations, nil)
59
63
  actual = service.ping
60
64
 
@@ -46,7 +46,7 @@ const CloudPingModal = ({ title, isOpen, toggle }) => {
46
46
  isPending={status === STATUS.PENDING}
47
47
  authStatus={cert}
48
48
  />{' '}
49
- {cert.org_name}
49
+ {cert.org_name} {cert.error}
50
50
  </>
51
51
  ),
52
52
  },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.31
4
+ version: 4.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-27 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello