foreman_rh_cloud 2.0.13.1 → 2.0.14
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/lib/foreman_inventory_upload/generators/slice.rb +1 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/package.json +1 -1
- data/test/unit/slice_generator_test.rb +36 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js +2 -2
- data/webpack/InsightsCloudSync/InsightsCloudSync.js +1 -1
- data/webpack/InsightsCloudSync/__snapshots__/InsightsCloudSync.test.js.snap +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 778b0d71a8930862a9ea89c96b28024ef830b62bfe09c393da68200884bf1581
|
4
|
+
data.tar.gz: '01600923d9766697d70c1739a1e8a2257357804c01200b5571f8b63464401f8e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e48907c9626cbf815b00bc257a45801f5a55d0f5f6e797cf7d11fadd549e822580d420e60004efa8e92aabb75c1c3b799ecda447c06fa53a6cc7a36a72160747
|
7
|
+
data.tar.gz: 853e77b02847333267442716d2c4909cd9738cd1dbdcfa7a063b0a09859b90832f73f75cd2db78565ffaffba000aa0fdd8ea6924ad98d74f554a998f17cd5964
|
@@ -107,7 +107,7 @@ module ForemanInventoryUpload
|
|
107
107
|
{
|
108
108
|
'ipv4_addresses': [host_ips_cache[nic.ip]].compact,
|
109
109
|
'ipv6_addresses': [nic.ip6].compact,
|
110
|
-
'mtu': nic.try(:mtu),
|
110
|
+
'mtu': nic.try(:mtu) && nic.mtu.to_i,
|
111
111
|
'mac_address': nic.mac,
|
112
112
|
'name': nic.identifier,
|
113
113
|
}.compact.to_json
|
data/package.json
CHANGED
@@ -77,6 +77,11 @@ class SliceGeneratorTest < ActiveSupport::TestCase
|
|
77
77
|
assert_nil actual_system_profile['cores_per_socket']
|
78
78
|
assert_nil actual_system_profile['system_memory_bytes']
|
79
79
|
assert_nil actual_system_profile['os_release']
|
80
|
+
assert_not_nil(actual_network_interfaces = actual_system_profile['network_interfaces'])
|
81
|
+
assert_not_nil(actual_nic = actual_network_interfaces.first)
|
82
|
+
refute actual_nic.key?('mtu')
|
83
|
+
refute actual_nic.key?('mac_address')
|
84
|
+
refute actual_nic.key?('name')
|
80
85
|
end
|
81
86
|
|
82
87
|
test 'hosts report fields should be present if fact exist' do
|
@@ -99,7 +104,29 @@ class SliceGeneratorTest < ActiveSupport::TestCase
|
|
99
104
|
end
|
100
105
|
|
101
106
|
test 'generates ip_address and mac_address fields' do
|
102
|
-
|
107
|
+
nic = FactoryBot.build(:nic_managed)
|
108
|
+
nic.attrs['mtu'] = '1500'
|
109
|
+
@host.interfaces << nic
|
110
|
+
batch = Host.where(id: @host.id).in_batches.first
|
111
|
+
generator = create_generator(batch)
|
112
|
+
|
113
|
+
json_str = generator.render
|
114
|
+
actual = JSON.parse(json_str.join("\n"))
|
115
|
+
|
116
|
+
assert_equal 'slice_123', actual['report_slice_id']
|
117
|
+
assert_not_nil(actual_host = actual['hosts'].first)
|
118
|
+
assert_equal @host.interfaces.where.not(ip: nil).first.ip, actual_host['ip_addresses'].first
|
119
|
+
assert_equal @host.interfaces.where.not(mac: nil).first.mac, actual_host['mac_addresses'].first
|
120
|
+
assert_equal @host.fqdn, actual_host['fqdn']
|
121
|
+
assert_equal '1234', actual_host['account']
|
122
|
+
assert_equal 1, generator.hosts_count
|
123
|
+
end
|
124
|
+
|
125
|
+
test 'generates nic fields' do
|
126
|
+
ip6 = Array.new(4) { '%x' % rand(16**4) }.join(':') + '::' + '5'
|
127
|
+
nic = FactoryBot.build(:nic_managed, ip6: ip6)
|
128
|
+
nic.attrs['mtu'] = '1500'
|
129
|
+
@host.interfaces << nic
|
103
130
|
batch = Host.where(id: @host.id).in_batches.first
|
104
131
|
generator = create_generator(batch)
|
105
132
|
|
@@ -110,6 +137,14 @@ class SliceGeneratorTest < ActiveSupport::TestCase
|
|
110
137
|
assert_not_nil(actual_host = actual['hosts'].first)
|
111
138
|
assert_equal @host.interfaces.where.not(ip: nil).first.ip, actual_host['ip_addresses'].first
|
112
139
|
assert_equal @host.interfaces.where.not(mac: nil).first.mac, actual_host['mac_addresses'].first
|
140
|
+
assert_not_nil(actual_system_profile = actual_host['system_profile'])
|
141
|
+
assert_not_nil(actual_network_interfaces = actual_system_profile['network_interfaces'])
|
142
|
+
assert_not_nil(actual_nic = actual_network_interfaces.first)
|
143
|
+
assert_equal nic.ip, actual_nic['ipv4_addresses'].first
|
144
|
+
assert_equal nic.ip6, actual_nic['ipv6_addresses'].first
|
145
|
+
assert_equal 1500, actual_nic['mtu']
|
146
|
+
assert_equal nic.mac, actual_nic['mac_address']
|
147
|
+
assert_equal nic.identifier, actual_nic['name']
|
113
148
|
assert_equal @host.fqdn, actual_host['fqdn']
|
114
149
|
assert_equal '1234', actual_host['account']
|
115
150
|
assert_equal 1, generator.hosts_count
|
data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Modal.js
CHANGED
@@ -21,10 +21,10 @@ const SyncModal = ({ show, toggleModal }) => (
|
|
21
21
|
<Modal.Body>
|
22
22
|
<Grid>
|
23
23
|
<p>
|
24
|
-
{__(`Please go over the following steps to add a
|
24
|
+
{__(`Please go over the following steps to add a Red Hat API token:`)}
|
25
25
|
</p>
|
26
26
|
<p>
|
27
|
-
{__(`1. Obtain an
|
27
|
+
{__(`1. Obtain an Red Hat API token: `)}
|
28
28
|
<a
|
29
29
|
href="https://access.redhat.com/management/api"
|
30
30
|
target="_blank"
|
@@ -19,7 +19,7 @@ const InsightsCloudSync = ({ settingsUrl, syncInsights }) => {
|
|
19
19
|
recommendations output for hosts managed here`)}
|
20
20
|
</p>
|
21
21
|
<p>
|
22
|
-
{__(`1. Obtain an
|
22
|
+
{__(`1. Obtain an Red Hat API token: `)}
|
23
23
|
<a
|
24
24
|
href="https://access.redhat.com/management/api"
|
25
25
|
target="_blank"
|
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: 2.0.
|
4
|
+
version: 2.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Red Hat Cloud team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: katello
|
@@ -525,7 +525,7 @@ homepage: https://github.com/theforeman/foreman_rh_cloud
|
|
525
525
|
licenses:
|
526
526
|
- GPL-3.0
|
527
527
|
metadata: {}
|
528
|
-
post_install_message:
|
528
|
+
post_install_message:
|
529
529
|
rdoc_options: []
|
530
530
|
require_paths:
|
531
531
|
- lib
|
@@ -540,25 +540,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
540
540
|
- !ruby/object:Gem::Version
|
541
541
|
version: '0'
|
542
542
|
requirements: []
|
543
|
-
rubygems_version: 3.
|
544
|
-
signing_key:
|
543
|
+
rubygems_version: 3.1.4
|
544
|
+
signing_key:
|
545
545
|
specification_version: 4
|
546
546
|
summary: Summary of ForemanRhCloud.
|
547
547
|
test_files:
|
548
|
-
- test/test_plugin_helper.rb
|
549
|
-
- test/factories/inventory_upload_factories.rb
|
550
|
-
- test/factories/insights_factories.rb
|
551
|
-
- test/controllers/reports_controller_test.rb
|
552
|
-
- test/controllers/uploads_controller_test.rb
|
553
548
|
- test/controllers/accounts_controller_test.rb
|
554
549
|
- test/controllers/insights_sync/settings_controller_test.rb
|
555
|
-
- test/
|
550
|
+
- test/controllers/reports_controller_test.rb
|
551
|
+
- test/controllers/uploads_controller_test.rb
|
552
|
+
- test/factories/insights_factories.rb
|
553
|
+
- test/factories/inventory_upload_factories.rb
|
554
|
+
- test/jobs/insights_full_sync_test.rb
|
555
|
+
- test/jobs/inventory_full_sync_test.rb
|
556
|
+
- test/jobs/upload_report_job_test.rb
|
557
|
+
- test/test_plugin_helper.rb
|
558
|
+
- test/unit/archived_report_generator_test.rb
|
556
559
|
- test/unit/metadata_generator_test.rb
|
557
|
-
- test/unit/rh_cloud_http_proxy_test.rb
|
558
560
|
- test/unit/shell_process_job_test.rb
|
559
|
-
- test/unit/insights_facet_test.rb
|
560
|
-
- test/unit/archived_report_generator_test.rb
|
561
561
|
- test/unit/fact_helpers_test.rb
|
562
|
-
- test/
|
563
|
-
- test/
|
564
|
-
- test/
|
562
|
+
- test/unit/insights_facet_test.rb
|
563
|
+
- test/unit/rh_cloud_http_proxy_test.rb
|
564
|
+
- test/unit/slice_generator_test.rb
|