foreman_discovery 16.0.0 → 16.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/discovered_hosts_controller.rb +10 -3
- data/app/controllers/api/v2/discovery_rules_controller.rb +1 -1
- data/app/controllers/discovered_hosts_controller.rb +5 -3
- data/app/controllers/discovery_rules_controller.rb +1 -1
- data/app/models/discovery_rule.rb +1 -1
- data/app/models/host/discovered.rb +39 -17
- data/app/models/host/managed_extensions.rb +2 -2
- data/app/services/foreman_discovery/host_converter.rb +15 -7
- data/app/services/foreman_discovery/node_api/node_resource.rb +1 -0
- data/app/views/discovered_hosts/_discovered_host_modal.html.erb +0 -2
- data/app/views/foreman_discovery/debian_kexec.erb +1 -1
- data/db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb +1 -1
- data/db/migrate/20151023144501_regenerate_red_hat_kexec.rb +1 -1
- data/db/migrate/20180412124505_add_priority_score_to_discovery_rules.rb +1 -1
- data/extra/discover-host +14 -8
- data/lib/foreman_discovery/engine.rb +2 -2
- data/lib/foreman_discovery/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ca/foreman_discovery.edit.po +215 -263
- data/locale/ca/foreman_discovery.po +16 -8
- data/locale/de/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/de/foreman_discovery.edit.po +217 -266
- data/locale/de/foreman_discovery.po +22 -14
- data/locale/en/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/en/foreman_discovery.edit.po +175 -133
- data/locale/en/foreman_discovery.po +12 -4
- data/locale/en_GB/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/en_GB/foreman_discovery.edit.po +221 -269
- data/locale/en_GB/foreman_discovery.po +18 -10
- data/locale/es/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/es/foreman_discovery.edit.po +240 -286
- data/locale/es/foreman_discovery.po +22 -14
- data/locale/foreman_discovery.pot +34 -24
- data/locale/fr/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/fr/foreman_discovery.edit.po +242 -291
- data/locale/fr/foreman_discovery.po +20 -12
- data/locale/gl/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/gl/foreman_discovery.edit.po +213 -261
- data/locale/gl/foreman_discovery.po +14 -6
- data/locale/it/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/it/foreman_discovery.edit.po +216 -264
- data/locale/it/foreman_discovery.po +17 -9
- data/locale/ja/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ja/foreman_discovery.edit.po +246 -294
- data/locale/ja/foreman_discovery.po +20 -12
- data/locale/ko/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ko/foreman_discovery.edit.po +216 -263
- data/locale/ko/foreman_discovery.po +20 -12
- data/locale/pt_BR/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/pt_BR/foreman_discovery.edit.po +237 -282
- data/locale/pt_BR/foreman_discovery.po +20 -12
- data/locale/ru/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/ru/foreman_discovery.edit.po +219 -265
- data/locale/ru/foreman_discovery.po +20 -12
- data/locale/sv_SE/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/sv_SE/foreman_discovery.edit.po +213 -261
- data/locale/sv_SE/foreman_discovery.po +14 -6
- data/locale/zh_CN/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/zh_CN/foreman_discovery.edit.po +283 -332
- data/locale/zh_CN/foreman_discovery.po +20 -12
- data/locale/zh_TW/LC_MESSAGES/foreman_discovery.mo +0 -0
- data/locale/zh_TW/foreman_discovery.edit.po +216 -262
- data/locale/zh_TW/foreman_discovery.po +18 -10
- data/test/facts/vmware-facter4-nolegacy.json +402 -0
- data/test/functional/discovered_hosts_controller_test.rb +15 -6
- data/test/unit/discovered_extensions_test.rb +6 -1
- data/test/unit/managed_extensions_test.rb +1 -0
- metadata +36 -32
@@ -8,7 +8,7 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
8
8
|
setup do
|
9
9
|
assert discovered_notification_blueprint
|
10
10
|
@request.env['HTTP_REFERER'] = '/discovery_rules'
|
11
|
-
FactoryBot.create(:subnet, :network => "192.168.100.1", :mask => "255.255.255.0", :locations => [location_one], :organizations => [organization_one])
|
11
|
+
FactoryBot.create(:subnet, :dhcp, :network => "192.168.100.1", :mask => "255.255.255.0", :locations => [location_one], :organizations => [organization_one])
|
12
12
|
@facts = {
|
13
13
|
"interfaces" => "lo,eth0",
|
14
14
|
"ipaddress" => "192.168.100.42",
|
@@ -115,7 +115,7 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
115
115
|
} }, session: set_session_user_default_manager
|
116
116
|
# all inherit buttons are pressed
|
117
117
|
assert_select('button[name=is_overridden_btn]') do |e|
|
118
|
-
e.attribute("class") =~ /active/
|
118
|
+
e.attribute("class").to_s =~ /active/
|
119
119
|
end
|
120
120
|
# particular fields are set
|
121
121
|
assert_select '#host_hostgroup_id [selected]' do |e|
|
@@ -140,6 +140,7 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
140
140
|
|
141
141
|
def test_update_inheritance
|
142
142
|
host = discover_host_from_facts(@facts)
|
143
|
+
ForemanDiscovery::HostConverter.stubs(:unused_ip_for_subnet).returns(host.ip)
|
143
144
|
hostgroup = setup_hostgroup(host)
|
144
145
|
put :update, params: {
|
145
146
|
commit: 'Update',
|
@@ -186,7 +187,7 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
186
187
|
::ForemanDiscovery::NodeAPI::PowerService.any_instance.expects(:reboot).returns(false)
|
187
188
|
post :reboot, params: { :id => host.id }, session: set_session_user_default_manager
|
188
189
|
assert_redirected_to discovered_hosts_url
|
189
|
-
|
190
|
+
assert_match(/ERF42-4036/, flash[:error])
|
190
191
|
end
|
191
192
|
|
192
193
|
def test_reboot_error
|
@@ -195,7 +196,7 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
195
196
|
::ForemanDiscovery::NodeAPI::PowerService.any_instance.expects(:reboot).raises("request failed")
|
196
197
|
post :reboot, params: { :id => host.id }, session: set_session_user_default_manager
|
197
198
|
assert_redirected_to discovered_hosts_url
|
198
|
-
assert_match(/
|
199
|
+
assert_match(/ERF42-4036/, flash[:error])
|
199
200
|
end
|
200
201
|
|
201
202
|
def test_auto_provision_success
|
@@ -274,7 +275,7 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
274
275
|
::ForemanDiscovery::NodeAPI::PowerService.any_instance.expects(:reboot).returns(false)
|
275
276
|
post :submit_multiple_reboot, params: {:host_ids => host.id}, session: set_session_user(User.current)
|
276
277
|
assert_redirected_to discovered_hosts_url
|
277
|
-
|
278
|
+
assert_match(/ERF42-4036/, flash[:error])
|
278
279
|
assert_nil flash[:success]
|
279
280
|
end
|
280
281
|
|
@@ -284,12 +285,15 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
284
285
|
::ForemanDiscovery::NodeAPI::PowerService.any_instance.expects(:reboot).raises("request failed")
|
285
286
|
post :submit_multiple_reboot, params: {:host_ids => host.id}, session: set_session_user(User.current)
|
286
287
|
assert_redirected_to discovered_hosts_url
|
287
|
-
assert_match(/
|
288
|
+
assert_match(/ERF42-4036/, flash[:error])
|
288
289
|
assert_nil flash[:success]
|
289
290
|
end
|
290
291
|
|
291
292
|
def test_no_dns_rebuild_if_dns_pending
|
292
293
|
host = discover_host_from_facts(@facts)
|
294
|
+
ForemanDiscovery::HostConverter.stubs(:unused_ip_for_subnet).returns(host.ip)
|
295
|
+
Nic::Managed.any_instance.stubs(:dhcp_update_required?).returns(false)
|
296
|
+
Net::DHCP::Record.any_instance.stubs(:conflicting?).returns(false)
|
293
297
|
hostgroup = prepare_hostgroup_for_dns_rebuild(host)
|
294
298
|
Nic::Managed.any_instance.expects(:rebuild_dns).never
|
295
299
|
Host::Managed.any_instance.stubs(:skip_orchestration?).returns(false)
|
@@ -306,6 +310,9 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
306
310
|
|
307
311
|
def test_dns_rebuild
|
308
312
|
host = prepare_host_for_dns_rebuild
|
313
|
+
ForemanDiscovery::HostConverter.stubs(:unused_ip_for_subnet).returns(host.ip)
|
314
|
+
Nic::Managed.any_instance.stubs(:dhcp_update_required?).returns(false)
|
315
|
+
Net::DHCP::Record.any_instance.stubs(:conflicting?).returns(false)
|
309
316
|
hostgroup = prepare_hostgroup_for_dns_rebuild(host)
|
310
317
|
Nic::Managed.any_instance.expects(:rebuild_dns)
|
311
318
|
Host::Managed.any_instance.stubs(:skip_orchestration?).returns(false)
|
@@ -319,6 +326,8 @@ class DiscoveredHostsControllerTest < ActionController::TestCase
|
|
319
326
|
|
320
327
|
def test_dns_rebuild_with_auto_provision
|
321
328
|
host = prepare_host_for_dns_rebuild
|
329
|
+
ForemanDiscovery::HostConverter.stubs(:unused_ip_for_subnet).returns(host.ip)
|
330
|
+
Nic::Managed.any_instance.stubs(:dhcp_update_required?).returns(false)
|
322
331
|
hostgroup = prepare_hostgroup_for_dns_rebuild(host)
|
323
332
|
Nic::Managed.any_instance.expects(:rebuild_dns)
|
324
333
|
Host::Managed.any_instance.stubs(:skip_orchestration?).returns(false)
|
@@ -9,6 +9,7 @@ class DiscoveredExtensionsTest < ActiveSupport::TestCase
|
|
9
9
|
@facts = facts_simple_network100_42
|
10
10
|
@facts_ipv6 = facts_network_2001_db8
|
11
11
|
set_default_settings
|
12
|
+
ProxyAPI::DHCP.any_instance.stubs(:record).returns(nil)
|
12
13
|
::ForemanDiscovery::HostConverter.stubs(:unused_ip_for_host)
|
13
14
|
end
|
14
15
|
|
@@ -204,6 +205,8 @@ class DiscoveredExtensionsTest < ActiveSupport::TestCase
|
|
204
205
|
assert_empty host.errors
|
205
206
|
assert managed_host
|
206
207
|
assert_empty managed_host.errors
|
208
|
+
refute_nil hostgroup.subnet
|
209
|
+
refute_nil managed_host.subnet
|
207
210
|
assert_equal hostgroup.subnet, managed_host.subnet
|
208
211
|
assert_equal "192.168.101.13", managed_host.ip
|
209
212
|
end
|
@@ -224,7 +227,9 @@ class DiscoveredExtensionsTest < ActiveSupport::TestCase
|
|
224
227
|
assert_empty host.errors
|
225
228
|
assert managed_host
|
226
229
|
assert_empty managed_host.errors
|
227
|
-
|
230
|
+
refute_nil hostgroup.subnet6
|
231
|
+
refute_nil managed_host.subnet6
|
232
|
+
assert_equal hostgroup.subnet6, managed_host.subnet6
|
228
233
|
assert_equal "2001:db9::a8bb:ccff:fedd:eefa", managed_host.ip6
|
229
234
|
end
|
230
235
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_discovery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.
|
4
|
+
version: 16.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aditi Puntambekar
|
@@ -9,6 +9,7 @@ authors:
|
|
9
9
|
- Alon Goldboim
|
10
10
|
- amirfefer
|
11
11
|
- Amit Karsale
|
12
|
+
- Amit Upadhye
|
12
13
|
- Amos Benari
|
13
14
|
- Avi Sharvit
|
14
15
|
- Bryan Kearney
|
@@ -34,6 +35,7 @@ authors:
|
|
34
35
|
- kgaikwad
|
35
36
|
- Lars Berntzon
|
36
37
|
- ldjebran
|
38
|
+
- Leos Stejskal
|
37
39
|
- Lukas Zapletal
|
38
40
|
- Lukáš Zapletal
|
39
41
|
- Marek Hulan
|
@@ -66,10 +68,10 @@ authors:
|
|
66
68
|
- Tom Caspy
|
67
69
|
- Tomer Brisker
|
68
70
|
- Yann Cézard
|
69
|
-
autorequire:
|
71
|
+
autorequire:
|
70
72
|
bindir: bin
|
71
73
|
cert_chain: []
|
72
|
-
date:
|
74
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
73
75
|
dependencies: []
|
74
76
|
description: MaaS Discovery Plugin engine for Foreman
|
75
77
|
email: gsutclif@redhat.com
|
@@ -249,6 +251,7 @@ files:
|
|
249
251
|
- test/facts/rhel7-vlan.json
|
250
252
|
- test/facts/simple-bond.json
|
251
253
|
- test/facts/suse-vmware.json
|
254
|
+
- test/facts/vmware-facter4-nolegacy.json
|
252
255
|
- test/facts/vmware_local.json
|
253
256
|
- test/functional/api/v2/discovered_hosts_controller_test.rb
|
254
257
|
- test/functional/api/v2/discovery_rules_controller_test.rb
|
@@ -277,7 +280,7 @@ homepage: https://github.com/theforeman/foreman_discovery
|
|
277
280
|
licenses:
|
278
281
|
- GPL-3.0
|
279
282
|
metadata: {}
|
280
|
-
post_install_message:
|
283
|
+
post_install_message:
|
281
284
|
rdoc_options: []
|
282
285
|
require_paths:
|
283
286
|
- lib
|
@@ -292,47 +295,48 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
295
|
- !ruby/object:Gem::Version
|
293
296
|
version: '0'
|
294
297
|
requirements: []
|
295
|
-
rubygems_version: 3.
|
296
|
-
signing_key:
|
298
|
+
rubygems_version: 3.1.4
|
299
|
+
signing_key:
|
297
300
|
specification_version: 4
|
298
301
|
summary: MaaS Discovery Plugin for Foreman
|
299
302
|
test_files:
|
300
|
-
- test/
|
301
|
-
- test/
|
302
|
-
- test/functional/api/v2/discovered_hosts_controller_test.rb
|
303
|
-
- test/functional/api/v2/fact_value_extensions_test.rb
|
304
|
-
- test/functional/api/v2/settings_controller_test.rb
|
305
|
-
- test/functional/api/v2/discovery_rules_controller_test.rb
|
306
|
-
- test/functional/discovery_rules_controller_test.rb
|
307
|
-
- test/integration/discovered_hosts_test.rb
|
308
|
-
- test/test_plugin_helper.rb
|
309
|
-
- test/facts/facts_with_lldp.json
|
310
|
-
- test/facts/dell_vlan.json
|
303
|
+
- test/factories/discovery_host_related.rb
|
304
|
+
- test/factories/discovery_rule_related.rb
|
311
305
|
- test/facts/bond0-eth0-eth1-active-passive.json
|
312
|
-
- test/facts/
|
313
|
-
- test/facts/rhel-r730.json
|
306
|
+
- test/facts/default.json
|
314
307
|
- test/facts/dell_npars.json
|
308
|
+
- test/facts/dell_vlan.json
|
309
|
+
- test/facts/facts_with_lldp.json
|
310
|
+
- test/facts/facts_with_lldp_bond_candidate.json
|
315
311
|
- test/facts/pxeless-vlan.json
|
316
312
|
- test/facts/regular_host.json
|
317
|
-
- test/facts/facts_with_lldp_bond_candidate.json
|
318
|
-
- test/facts/rhel7-vlan.json
|
319
|
-
- test/facts/default.json
|
320
313
|
- test/facts/rhel-dl380-1kdisks.json
|
314
|
+
- test/facts/rhel-r730.json
|
315
|
+
- test/facts/rhel7-vlan.json
|
316
|
+
- test/facts/simple-bond.json
|
321
317
|
- test/facts/suse-vmware.json
|
318
|
+
- test/facts/vmware-facter4-nolegacy.json
|
322
319
|
- test/facts/vmware_local.json
|
320
|
+
- test/functional/api/v2/discovery_rules_controller_test.rb
|
321
|
+
- test/functional/api/v2/fact_value_extensions_test.rb
|
322
|
+
- test/functional/api/v2/discovered_hosts_controller_test.rb
|
323
|
+
- test/functional/api/v2/settings_controller_test.rb
|
324
|
+
- test/functional/foreman_discovery/concerns/hosts_controller_extensions_test.rb
|
325
|
+
- test/functional/discovered_hosts_controller_test.rb
|
326
|
+
- test/functional/discovery_rules_controller_test.rb
|
327
|
+
- test/integration/discovered_hosts_test.rb
|
328
|
+
- test/models/setting_test.rb
|
329
|
+
- test/unit/ui_notifications/destroy_host_test.rb
|
330
|
+
- test/unit/ui_notifications/new_host_test.rb
|
331
|
+
- test/unit/discovered_extensions_test.rb
|
332
|
+
- test/unit/discovered_mailer_test.rb
|
333
|
+
- test/unit/discovery_attribute_set_test.rb
|
323
334
|
- test/unit/discovery_rule_test.rb
|
324
335
|
- test/unit/discovery_taxonomy_extensions_test.rb
|
325
|
-
- test/unit/discovered_mailer_test.rb
|
326
336
|
- test/unit/fact_parser_test.rb
|
327
|
-
- test/unit/discovered_extensions_test.rb
|
328
|
-
- test/unit/setting_discovered_test.rb
|
329
|
-
- test/unit/host_discovered_test.rb
|
330
337
|
- test/unit/lldp_neighbors_test.rb
|
331
|
-
- test/unit/ui_notifications/destroy_host_test.rb
|
332
|
-
- test/unit/ui_notifications/new_host_test.rb
|
333
|
-
- test/unit/discovery_attribute_set_test.rb
|
334
338
|
- test/unit/managed_extensions_test.rb
|
335
|
-
- test/
|
339
|
+
- test/unit/setting_discovered_test.rb
|
340
|
+
- test/unit/host_discovered_test.rb
|
341
|
+
- test/test_plugin_helper.rb
|
336
342
|
- test/test_helper_discovery.rb
|
337
|
-
- test/factories/discovery_rule_related.rb
|
338
|
-
- test/factories/discovery_host_related.rb
|