foreman_discovery 26.1.1 → 26.1.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6112ecd76ae40ea9268e05f91f16c0b69de5674281e8912536450e5b8ab19a38
|
|
4
|
+
data.tar.gz: bcef41d260a1474a25847b342a49f091a1295192f9b48adee255ca7703c0c4e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dce53b728b4203c75b59afbcff27b98169042dbee6c2e9ab12d25e3ddf18d89105ea8ddcef49fe1324712de97a8987fe3baecb5bd9c549c657896bf9ab3b3819
|
|
7
|
+
data.tar.gz: 89919e7074fdb7d484d861940ae3f6dbc249443471594cdc8d239b301c08a29b7f9e38c1d427568f04d1a07c4aa59e5112fb53aa18cca5c0c06c7c59473a581f
|
|
@@ -2,7 +2,7 @@ module ForemanDiscovery
|
|
|
2
2
|
module Concerns
|
|
3
3
|
module HostsControllerExtensions
|
|
4
4
|
extend ActiveSupport::Concern
|
|
5
|
-
|
|
5
|
+
prepended do
|
|
6
6
|
before_action :set_discovered_params
|
|
7
7
|
end
|
|
8
8
|
|
|
@@ -13,6 +13,12 @@ module ForemanDiscovery
|
|
|
13
13
|
return if params[:discovered_host].nil?
|
|
14
14
|
params[:host] ||= params.delete(:discovered_host)
|
|
15
15
|
end
|
|
16
|
+
|
|
17
|
+
def host_for_template_used
|
|
18
|
+
super
|
|
19
|
+
|
|
20
|
+
@host = ::ForemanDiscovery::HostConverter.to_managed(@host, true, false, host_params) if @host.is_a?(Host::Discovered)
|
|
21
|
+
end
|
|
16
22
|
end
|
|
17
23
|
end
|
|
18
24
|
end
|
|
@@ -347,7 +347,7 @@ module ForemanDiscovery
|
|
|
347
347
|
::Nic::Managed.send :include, Nic::ManagedExtensions
|
|
348
348
|
|
|
349
349
|
# Controller extensions
|
|
350
|
-
::HostsController.send :
|
|
350
|
+
::HostsController.send :prepend, ForemanDiscovery::Concerns::HostsControllerExtensions
|
|
351
351
|
::Api::V2::FactValuesController.send :include, Api::V2::FactValuesControllerExtensions
|
|
352
352
|
|
|
353
353
|
Foreman::Plugin.fact_importer_registry.register(:foreman_discovery, DiscoveryFactImporter)
|
|
@@ -18,6 +18,38 @@ module ForemanDiscovery
|
|
|
18
18
|
assert_match(/"#{os.id}"/, response.body)
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
|
+
|
|
22
|
+
describe 'template_used' do
|
|
23
|
+
include FactImporterIsolation
|
|
24
|
+
allow_transactions_for_any_importer
|
|
25
|
+
|
|
26
|
+
setup do
|
|
27
|
+
@facts = {
|
|
28
|
+
"interfaces" => "lo,eth0",
|
|
29
|
+
"ipaddress" => "192.168.100.42",
|
|
30
|
+
"ipaddress_eth0" => "192.168.100.42",
|
|
31
|
+
"macaddress_eth0" => "AA:BB:CC:DD:EE:FF",
|
|
32
|
+
"discovery_bootif" => "AA:BB:CC:DD:EE:FF",
|
|
33
|
+
"physicalprocessorcount" => "42",
|
|
34
|
+
"discovery_version" => "3.0.0",
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
test 'converts the discovered host to a managed host' do
|
|
39
|
+
host = discover_host_from_facts(@facts)
|
|
40
|
+
params = {
|
|
41
|
+
id: host.id,
|
|
42
|
+
host: {
|
|
43
|
+
architecture_id: architectures(:x86_64).id, # rubocop:disable Naming/VariableNumber
|
|
44
|
+
operatingsystem_id: operatingsystems(:redhat).id,
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
get :template_used, params: params, session: set_session_user
|
|
48
|
+
|
|
49
|
+
assert_response :success
|
|
50
|
+
assert_instance_of Host::Managed, assigns(:host)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
21
53
|
end
|
|
22
54
|
end
|
|
23
55
|
end
|
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: 26.1.
|
|
4
|
+
version: 26.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aditi Puntambekar
|
|
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
329
329
|
- !ruby/object:Gem::Version
|
|
330
330
|
version: '0'
|
|
331
331
|
requirements: []
|
|
332
|
-
rubygems_version:
|
|
332
|
+
rubygems_version: 4.0.3
|
|
333
333
|
specification_version: 4
|
|
334
334
|
summary: MaaS Discovery Plugin for Foreman
|
|
335
335
|
test_files:
|