foreman_discovery 26.0.2 → 26.1.0
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: e90157d36e1ea37c8275996fb86a182fdf1f8eb20924bdef5a4b7cc6e8a21099
|
4
|
+
data.tar.gz: 39bd25814b3cd8c0bdc969376b13cf25e63992a113a140b01585611c3ace7074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bad020350128852a549969f4d79b36a3d2c50f2e3a4de94eb338ddf17a5fe80ce999b5acb21eaebc3051f8a91300e5a5f97ecce13619b517b08563fa8fcc7e5
|
7
|
+
data.tar.gz: 4aaabbb5b7cebfe19d9537178d3cd745b3ce6e4333b78a237c151fcc8d37370290d35ac4006f11e41102cc75ca92009f918c3c49a487e413262fad07c6dc72a9
|
@@ -5,14 +5,16 @@ class ForemanDiscovery::HostConverter
|
|
5
5
|
def self.to_managed(original_host, set_managed = true, set_build = true, added_attributes = {})
|
6
6
|
host = original_host.becomes(::Host::Managed)
|
7
7
|
host.type = 'Host::Managed'
|
8
|
-
host.attributes = host.apply_inherited_attributes(added_attributes)
|
9
|
-
host.set_hostgroup_defaults if host.hostgroup_id.present?
|
10
8
|
|
11
9
|
# the following flags can be skipped when parameters are set to false
|
12
10
|
if set_managed
|
13
11
|
host.managed = set_managed
|
14
12
|
host.primary_interface.managed = set_managed
|
15
13
|
end
|
14
|
+
|
15
|
+
host.attributes = host.apply_inherited_attributes(added_attributes)
|
16
|
+
host.set_hostgroup_defaults if host.hostgroup_id.present?
|
17
|
+
|
16
18
|
# set build only and only on final save (facts are deleted)
|
17
19
|
set_build_clean_facts(host) if set_build
|
18
20
|
host
|
@@ -52,7 +54,7 @@ class ForemanDiscovery::HostConverter
|
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
55
|
-
def self.ip_for_subnet(subnet, mac, ip)
|
57
|
+
def self.ip_for_subnet(subnet, mac, ip)
|
56
58
|
return ip if ip && subnet&.unused_ip(mac)&.ip_include?(ip)
|
57
59
|
|
58
60
|
unused_ip_for_subnet(subnet, mac, ip)
|
@@ -21,7 +21,6 @@ module ForemanDiscovery
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
# rubocop:disable Metrics/BlockLength
|
25
24
|
initializer 'foreman_discovery.register_plugin', :before => :finisher_hook do |app|
|
26
25
|
app.reloader.to_prepare do
|
27
26
|
Foreman::Plugin.register :foreman_discovery do
|
@@ -149,13 +148,6 @@ module ForemanDiscovery
|
|
149
148
|
full_name: N_("Locked PXELinux template name"),
|
150
149
|
description: N_("PXELinux template to be used when pinning a host to discovery")
|
151
150
|
|
152
|
-
setting "discovery_pxegrub_lock_template",
|
153
|
-
type: :string,
|
154
|
-
collection: snippets,
|
155
|
-
default: "pxegrub_discovery",
|
156
|
-
full_name: N_("Locked PXEGrub template name"),
|
157
|
-
description: N_("PXEGrub template to be used when pinning a host to discovery")
|
158
|
-
|
159
151
|
setting "discovery_pxegrub2_lock_template",
|
160
152
|
type: :string,
|
161
153
|
collection: snippets,
|
@@ -332,7 +324,6 @@ module ForemanDiscovery
|
|
332
324
|
end
|
333
325
|
end
|
334
326
|
end
|
335
|
-
# rubocop:enable Metrics/BlockLength
|
336
327
|
|
337
328
|
initializer "foreman_discovery.apipie" do
|
338
329
|
if Apipie.configuration.respond_to?(:checksum_path)
|
@@ -62,7 +62,6 @@ def set_default_settings
|
|
62
62
|
Setting['discovery_clean_facts'] = false
|
63
63
|
Setting['discovery_lock'] = false
|
64
64
|
Setting['discovery_pxelinux_lock_template'] = 'pxelinux_discovery'
|
65
|
-
Setting['discovery_pxegrub_lock_template'] = 'pxegrub_discovery'
|
66
65
|
Setting['discovery_pxegrub2_lock_template'] = 'pxegrub2_discovery'
|
67
66
|
Setting['discovery_always_rebuild_dns'] = true
|
68
67
|
Setting['discovery_error_on_existing'] = false
|
@@ -202,7 +202,7 @@ class HostDiscoveredTest < ActiveSupport::TestCase
|
|
202
202
|
:locations => [location_one]
|
203
203
|
)
|
204
204
|
Subnet.expects(:subnet_for).with('10.35.27.2').returns(subnet)
|
205
|
-
ProxyAPI::TFTP.any_instance.expects(:set).with(anything, 'e4:1f:13:cc:36:58', anything).returns(true).times(
|
205
|
+
ProxyAPI::TFTP.any_instance.expects(:set).with(anything, 'e4:1f:13:cc:36:58', anything).returns(true).times(2)
|
206
206
|
TemplateKind::PXE.each do |kind|
|
207
207
|
ProvisioningTemplate.where(:name => "#{kind.downcase}_discovery").first_or_create(
|
208
208
|
:template_kind_id => template_kinds(kind.downcase.to_sym),
|