foreman_discovery 5.0.2 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/discovered_hosts_controller.rb +4 -7
  3. data/app/controllers/api/v2/discovery_rules_controller.rb +1 -0
  4. data/app/controllers/api/v2/fact_values_controller_extensions.rb +11 -0
  5. data/app/controllers/concerns/foreman/controller/discovered_extensions.rb +6 -3
  6. data/app/controllers/discovered_hosts_controller.rb +46 -11
  7. data/app/controllers/discovery_rules_controller.rb +1 -1
  8. data/app/helpers/discovered_hosts_helper.rb +33 -16
  9. data/app/models/concerns/discovery_taxonomy_extensions.rb +7 -0
  10. data/app/models/concerns/fact_value_extensions.rb +8 -0
  11. data/app/models/discovery_rule.rb +4 -6
  12. data/app/models/host/discovered.rb +29 -10
  13. data/app/models/host/managed_extensions.rb +2 -10
  14. data/app/models/setting/discovered.rb +22 -28
  15. data/app/services/foreman_discovery/host_converter.rb +19 -10
  16. data/app/views/api/v2/discovered_hosts/main.json.rabl +1 -1
  17. data/app/views/dashboard/_discovery_widget_host.html.erb +1 -1
  18. data/app/views/discovered_hosts/_discovered_host.html.erb +1 -1
  19. data/app/views/discovered_hosts/_discovered_hosts_list.html.erb +32 -1
  20. data/app/views/discovered_hosts/index.html.erb +2 -2
  21. data/app/views/discovered_hosts/show.html.erb +5 -5
  22. data/app/views/discovered_mailer/_discovered_host.html.erb +1 -1
  23. data/app/views/discovered_mailer/discovered_summary.text.erb +2 -2
  24. data/app/views/discovery_rules/_form.html.erb +2 -19
  25. data/app/views/discovery_rules/_template_inline.erb +10 -0
  26. data/app/views/discovery_rules/index.html.erb +1 -1
  27. data/app/views/foreman_discovery/debian_kexec.erb +34 -0
  28. data/app/views/foreman_discovery/redhat_kexec.erb +5 -4
  29. data/config/routes.rb +4 -0
  30. data/db/migrate/20141223142759_fill_discovery_attribute_sets_for_existing_hosts.rb +15 -1
  31. data/db/migrate/20160719124942_add_missing_view_permissions.rb +18 -0
  32. data/db/seeds.d/50_discovery_templates.rb +15 -13
  33. data/lib/discovery.rake +1 -0
  34. data/lib/foreman_discovery/engine.rb +24 -10
  35. data/lib/foreman_discovery/version.rb +1 -1
  36. data/locale/ca/LC_MESSAGES/foreman_discovery.mo +0 -0
  37. data/locale/ca/foreman_discovery.edit.po +274 -136
  38. data/locale/ca/foreman_discovery.po +396 -328
  39. data/locale/de/LC_MESSAGES/foreman_discovery.mo +0 -0
  40. data/locale/de/foreman_discovery.edit.po +309 -171
  41. data/locale/de/foreman_discovery.po +419 -361
  42. data/locale/en/LC_MESSAGES/foreman_discovery.mo +0 -0
  43. data/locale/en/foreman_discovery.edit.po +881 -0
  44. data/locale/en/foreman_discovery.po +665 -0
  45. data/locale/en_GB/LC_MESSAGES/foreman_discovery.mo +0 -0
  46. data/locale/en_GB/foreman_discovery.edit.po +279 -141
  47. data/locale/en_GB/foreman_discovery.po +446 -391
  48. data/locale/es/LC_MESSAGES/foreman_discovery.mo +0 -0
  49. data/locale/es/foreman_discovery.edit.po +277 -139
  50. data/locale/es/foreman_discovery.po +415 -362
  51. data/locale/foreman_discovery.pot +241 -135
  52. data/locale/fr/LC_MESSAGES/foreman_discovery.mo +0 -0
  53. data/locale/fr/foreman_discovery.edit.po +289 -151
  54. data/locale/fr/foreman_discovery.po +439 -411
  55. data/locale/gl/LC_MESSAGES/foreman_discovery.mo +0 -0
  56. data/locale/gl/foreman_discovery.edit.po +266 -128
  57. data/locale/gl/foreman_discovery.po +320 -246
  58. data/locale/it/LC_MESSAGES/foreman_discovery.mo +0 -0
  59. data/locale/it/foreman_discovery.edit.po +277 -139
  60. data/locale/it/foreman_discovery.po +407 -352
  61. data/locale/ja/LC_MESSAGES/foreman_discovery.mo +0 -0
  62. data/locale/ja/foreman_discovery.edit.po +279 -141
  63. data/locale/ja/foreman_discovery.po +411 -339
  64. data/locale/ko/LC_MESSAGES/foreman_discovery.mo +0 -0
  65. data/locale/ko/foreman_discovery.edit.po +277 -139
  66. data/locale/ko/foreman_discovery.po +411 -339
  67. data/locale/pt_BR/LC_MESSAGES/foreman_discovery.mo +0 -0
  68. data/locale/pt_BR/foreman_discovery.edit.po +282 -144
  69. data/locale/pt_BR/foreman_discovery.po +430 -394
  70. data/locale/ru/LC_MESSAGES/foreman_discovery.mo +0 -0
  71. data/locale/ru/foreman_discovery.edit.po +371 -232
  72. data/locale/ru/foreman_discovery.po +448 -385
  73. data/locale/sv_SE/LC_MESSAGES/foreman_discovery.mo +0 -0
  74. data/locale/sv_SE/foreman_discovery.edit.po +270 -132
  75. data/locale/sv_SE/foreman_discovery.po +336 -260
  76. data/locale/zh_CN/LC_MESSAGES/foreman_discovery.mo +0 -0
  77. data/locale/zh_CN/foreman_discovery.edit.po +279 -141
  78. data/locale/zh_CN/foreman_discovery.po +412 -336
  79. data/locale/zh_TW/LC_MESSAGES/foreman_discovery.mo +0 -0
  80. data/locale/zh_TW/foreman_discovery.edit.po +279 -141
  81. data/locale/zh_TW/foreman_discovery.po +412 -338
  82. data/test/functional/api/v2/discovered_hosts_controller_test.rb +30 -22
  83. data/test/functional/api/v2/discovery_rules_controller_test.rb +7 -0
  84. data/test/functional/api/v2/fact_value_extensions_test.rb +37 -0
  85. data/test/functional/discovered_hosts_controller_test.rb +89 -16
  86. data/test/functional/discovery_rules_controller_test.rb +1 -1
  87. data/test/test_helper_discovery.rb +1 -1
  88. data/test/unit/discovered_extensions_test.rb +65 -21
  89. data/test/unit/discovery_attribute_set_test.rb +4 -4
  90. data/test/unit/discovery_taxonomy_extensions_test.rb +31 -0
  91. data/test/unit/host_discovered_test.rb +110 -14
  92. metadata +121 -110
  93. data/app/helpers/concerns/foreman_discovery/settings_helper_extensions.rb +0 -34
@@ -15,7 +15,7 @@ class DiscoveryAttributeSetTest < ActiveSupport::TestCase
15
15
 
16
16
  test "can search discovered hosts by cpu" do
17
17
  raw = parse_json_fixture('/facts.json')
18
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
18
+ host = Host::Discovered.import_host(raw['facts'])
19
19
  results = Host::Discovered.search_for("cpu_count = #{host.facts_hash['physicalprocessorcount'].to_i}")
20
20
  assert_equal 1, results.count
21
21
  results = Host::Discovered.search_for("cpu_count > #{host.facts_hash['physicalprocessorcount'].to_i}")
@@ -24,7 +24,7 @@ class DiscoveryAttributeSetTest < ActiveSupport::TestCase
24
24
 
25
25
  test "can search discovered hosts by memory" do
26
26
  raw = parse_json_fixture('/facts.json')
27
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
27
+ host = Host::Discovered.import_host(raw['facts'])
28
28
  results = Host::Discovered.search_for("memory = #{host.facts_hash['memorysize_mb'].to_f.ceil}")
29
29
  assert_equal 1, results.count
30
30
  results = Host::Discovered.search_for("memory > #{host.facts_hash['memorysize_mb'].to_f.ceil}")
@@ -33,7 +33,7 @@ class DiscoveryAttributeSetTest < ActiveSupport::TestCase
33
33
 
34
34
  test "can search discovered hosts by disk_count" do
35
35
  raw = parse_json_fixture('/facts.json')
36
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
36
+ host = Host::Discovered.import_host(raw['facts'])
37
37
  results = Host::Discovered.search_for("disk_count = 1")
38
38
  assert_equal 1, results.count
39
39
  results = Host::Discovered.search_for("disk_count = 3")
@@ -42,7 +42,7 @@ class DiscoveryAttributeSetTest < ActiveSupport::TestCase
42
42
 
43
43
  test "can search discovered hosts by disks_size" do
44
44
  raw = parse_json_fixture('/facts.json')
45
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
45
+ host = Host::Discovered.import_host(raw['facts'])
46
46
  disks_size = (host.facts_hash['blockdevice_sda_size'].to_f / 1024 / 1024).ceil
47
47
  results = Host::Discovered.search_for("disks_size = #{disks_size}")
48
48
  assert_equal 1, results.count
@@ -0,0 +1,31 @@
1
+ require 'test_helper'
2
+
3
+ class DiscoveryTaxonomyExtensionsTest < ActiveSupport::TestCase
4
+ setup do
5
+ FactoryGirl.create(:setting,
6
+ :name => 'discovery_hostname',
7
+ :value => 'discovery_bootif',
8
+ :category => 'Setting::Discovered')
9
+ FactoryGirl.create(:setting,
10
+ :name => 'discovery_prefix',
11
+ :value => 'mac',
12
+ :category => 'Setting::Discovered')
13
+ end
14
+
15
+ test 'deleting location does not hard fail if there is associated discovered host' do
16
+ location = FactoryGirl.create(:location)
17
+
18
+ raw = parse_json_fixture('/facts.json')
19
+ assert (host = Host::Discovered.import_host(raw['facts']))
20
+ host.location = location
21
+ assert host.save
22
+
23
+ assert_nothing_raised do
24
+ refute location.destroy, 'Location was destroyed but it should not be allowed'
25
+ end
26
+ end
27
+
28
+ def parse_json_fixture(relative_path)
29
+ return JSON.parse(File.read(File.expand_path(File.dirname(__FILE__) + relative_path)))
30
+ end
31
+ end
@@ -14,6 +14,18 @@ class HostDiscoveredTest < ActiveSupport::TestCase
14
14
  :name => 'discovery_prefix',
15
15
  :value => 'mac',
16
16
  :category => 'Setting::Discovered')
17
+ FactoryGirl.create(:setting,
18
+ :name => 'discovery_lock',
19
+ :value => 'false',
20
+ :category => 'Setting::Discovered')
21
+ FactoryGirl.create(:setting,
22
+ :name => 'discovery_lock_template',
23
+ :value => 'pxelinux_discovery',
24
+ :category => 'Setting::Discovered')
25
+ FactoryGirl.create(:setting,
26
+ :name => 'discovery_clean_facts',
27
+ :value => false,
28
+ :category => 'Setting::Discovered')
17
29
  end
18
30
 
19
31
  test "should be able to create Host::Discovered objects" do
@@ -23,15 +35,15 @@ class HostDiscoveredTest < ActiveSupport::TestCase
23
35
 
24
36
  test "should import facts from yaml as Host::Discovered" do
25
37
  raw = parse_json_fixture('/facts.json')
26
- assert Host::Discovered.import_host_and_facts(raw['facts'])
38
+ assert Host::Discovered.import_host(raw['facts'])
27
39
  assert Host::Discovered.find_by_name('mace41f13cc3658')
28
40
  end
29
41
 
30
42
  test "should setup subnet" do
31
43
  raw = parse_json_fixture('/facts.json')
32
- subnet = FactoryGirl.create(:subnet, :organizations => [Organization.first], :locations => [Location.first])
44
+ subnet = FactoryGirl.create(:subnet_ipv4, :name => 'Subnet99', :network => '192.168.99.0', :organizations => [Organization.first], :locations => [Location.first])
33
45
  Subnet.expects(:subnet_for).with('10.35.27.3').returns(subnet)
34
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
46
+ host = Host::Discovered.import_host(raw['facts'])
35
47
  assert_equal subnet, host.primary_interface.subnet
36
48
  end
37
49
 
@@ -47,17 +59,38 @@ class HostDiscoveredTest < ActiveSupport::TestCase
47
59
  :value => loc.name,
48
60
  :category => 'Setting::Discovered')
49
61
  raw = parse_json_fixture('/facts.json')
50
- subnet = FactoryGirl.create(:subnet, :organizations => [org], :locations => [loc])
62
+ subnet = FactoryGirl.create(:subnet_ipv4, :name => 'Subnet99', :network => '192.168.99.0', :organizations => [org], :locations => [loc])
51
63
  Subnet.expects(:subnet_for).with('10.35.27.3').returns(subnet)
52
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
64
+ host = Host::Discovered.import_host(raw['facts'])
53
65
  assert_equal subnet, host.primary_interface.subnet
54
66
  end
55
67
 
68
+ test "should set nested org and loc" do
69
+ org_parent = FactoryGirl.create(:organization, :name => "org")
70
+ org = FactoryGirl.create(:organization, :name => "suborg", :parent_id => org_parent.id)
71
+ loc_parent = FactoryGirl.create(:location, :name => "loc")
72
+ loc = FactoryGirl.create(:location, :name => "subloc", :parent_id => loc_parent.id)
73
+ FactoryGirl.create(:setting,
74
+ :name => 'discovery_organization',
75
+ :value => org.name,
76
+ :category => 'Setting::Discovered')
77
+ FactoryGirl.create(:setting,
78
+ :name => 'discovery_location',
79
+ :value => loc.name,
80
+ :category => 'Setting::Discovered')
81
+ raw = parse_json_fixture('/facts.json')
82
+ subnet = FactoryGirl.create(:subnet_ipv4, :name => 'Subnet99', :network => '192.168.99.0', :organizations => [org], :locations => [loc])
83
+ Subnet.expects(:subnet_for).with('10.35.27.3').returns(subnet)
84
+ host = Host::Discovered.import_host(raw['facts'])
85
+ assert_equal org, host.organization
86
+ assert_equal loc, host.location
87
+ end
88
+
56
89
  test "should raise when fact_name setting isn't present" do
57
90
  raw = parse_json_fixture('/facts.json')
58
91
  Setting[:discovery_fact] = 'macaddress_foo'
59
92
  exception = assert_raises(::Foreman::Exception) do
60
- Host::Discovered.import_host_and_facts(raw['facts'])
93
+ Host::Discovered.import_host(raw['facts'])
61
94
  end
62
95
  assert_match(/Expected discovery_fact '\w+' is missing/, exception.message)
63
96
  end
@@ -73,17 +106,42 @@ class HostDiscoveredTest < ActiveSupport::TestCase
73
106
  raw = parse_json_fixture('/facts.json')
74
107
  Setting[:discovery_hostname] = 'somefact'
75
108
  facts = raw['facts'].merge({"somefact" => "somename"})
76
- host = Host::Discovered.import_host_and_facts(facts).first
109
+ host = Host::Discovered.import_host(facts)
77
110
  assert_equal 'macsomename', host.name
78
111
  refute_equal 'e4:1f:13:cc:36:5a', host.mac
79
112
  end
80
113
 
114
+ test "should lock host into discovery via PXE configuration" do
115
+ Host::Discovered.delete('mace41f13cc3658')
116
+ Setting[:discovery_lock] = "true"
117
+ Setting[:discovery_lock_template] = 'discovery_lock_template'
118
+ raw = parse_json_fixture('/facts.json')
119
+ subnet = FactoryGirl.create(:subnet,
120
+ :tftp,
121
+ :network => '10.35.27.0',
122
+ :cidr => '24',
123
+ :mask => '255.255.255.0',
124
+ :organizations => [Organization.first],
125
+ :locations => [Location.first]
126
+ )
127
+ Subnet.expects(:subnet_for).with('10.35.27.3').returns(subnet)
128
+ ProxyAPI::TFTP.any_instance.expects(:set).with('e4:1f:13:cc:36:58', anything).returns(true)
129
+ ProvisioningTemplate.where(:name => 'discovery_lock_template').first_or_create(
130
+ :template_kind_id => template_kinds(:ipxe),
131
+ :snippet => true,
132
+ :template => "test"
133
+ )
134
+ assert Host::Discovered.import_host(raw['facts'])
135
+ assert Host::Discovered.find_by_name('mace41f13cc3658')
136
+ refute Host::Managed.find_by_name('mace41f13cc3658')
137
+ end
138
+
81
139
  test "should create discovered host with fact_name as a name if it is a valid mac" do
82
140
  raw = parse_json_fixture('/facts.json')
83
141
  Setting[:discovery_fact] = 'somefact'
84
142
  Setting[:discovery_hostname] = 'somefact'
85
143
  facts = raw['facts'].merge({"somefact" => "E4:1F:13:CC:36:5A"})
86
- host = Host::Discovered.import_host_and_facts(facts).first
144
+ host = Host::Discovered.import_host(facts)
87
145
  assert_equal 'mace41f13cc365a', host.name
88
146
  assert_equal 'e4:1f:13:cc:36:5a', host.mac
89
147
  end
@@ -92,7 +150,7 @@ class HostDiscoveredTest < ActiveSupport::TestCase
92
150
  raw = parse_json_fixture('/facts.json')
93
151
  Setting[:discovery_fact] = 'lsbdistcodename'
94
152
  exception = assert_raises(::Foreman::Exception) do
95
- Host::Discovered.import_host_and_facts(raw['facts'])
153
+ Host::Discovered.import_host(raw['facts'])
96
154
  end
97
155
  assert_match(/Unable to detect primary interface using MAC/, exception.message)
98
156
  end
@@ -100,22 +158,31 @@ class HostDiscoveredTest < ActiveSupport::TestCase
100
158
  test "should create discovered host with prefix" do
101
159
  raw = parse_json_fixture('/facts.json')
102
160
  Setting[:discovery_prefix] = 'test'
103
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
161
+ host = Host::Discovered.import_host(raw['facts'])
104
162
  assert_equal 'teste41f13cc3658', host.name
105
163
  end
106
164
 
107
165
  test "should create discovered host without prefix" do
108
166
  raw = parse_json_fixture('/facts.json')
109
167
  Setting[:discovery_prefix] = ''
110
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
168
+ host = Host::Discovered.import_host(raw['facts'])
111
169
  assert_equal 'e41f13cc3658',host.name
112
170
  end
113
171
 
172
+ test "should refresh existing discovered" do
173
+ raw = parse_json_fixture('/facts.json')
174
+ interface = mock()
175
+ interface.stubs(:host).returns(Host.create(:name => "xyz", :type => "Host::Discovered"))
176
+ ::Nic::Managed.stubs(:where).with(:mac => raw['facts']['discovery_bootif'].downcase, :primary => true).returns([interface])
177
+ host = Host::Discovered.import_host(raw['facts'])
178
+ assert_equal 'xyz', host.name
179
+ end
180
+
114
181
  test "should raise when hostname fact cannot be found" do
115
182
  raw = parse_json_fixture('/facts.json')
116
183
  Setting[:discovery_hostname] = 'macaddress_foo'
117
184
  exception = assert_raises(::Foreman::Exception) do
118
- Host::Discovered.import_host_and_facts(raw['facts'])
185
+ Host::Discovered.import_host(raw['facts'])
119
186
  end
120
187
  assert_match(/Invalid facts: hash does not contain a valid value for any of the facts in the discovery_hostname setting:/, exception.message)
121
188
  end
@@ -126,7 +193,7 @@ class HostDiscoveredTest < ActiveSupport::TestCase
126
193
  Setting[:discovery_hostname] = 'invalidhostnamefact'
127
194
  Setting[:discovery_prefix] = ''
128
195
  exception = assert_raises(::Foreman::Exception) do
129
- Host::Discovered.import_host_and_facts(raw['facts'])
196
+ Host::Discovered.import_host(raw['facts'])
130
197
  end
131
198
  assert_match(/Invalid hostname: Could not normalize the hostname/, exception.message)
132
199
  end
@@ -161,13 +228,42 @@ class HostDiscoveredTest < ActiveSupport::TestCase
161
228
  Setting[:token_duration] = 30 #enable tokens so that we only test the CR
162
229
  raw = parse_json_fixture('/facts.json')
163
230
  Setting[:discovery_prefix] = '123'
164
- host = Host::Discovered.import_host_and_facts(raw['facts']).first
231
+ host = Host::Discovered.import_host(raw['facts'])
165
232
  host.save
166
233
  h = ::ForemanDiscovery::HostConverter.to_managed(host)
167
234
  refute_valid h
168
235
  assert Token.where(:host_id => h.id).empty?
169
236
  end
170
237
 
238
+ test "all non-discovery facts are deleted after provisioning" do
239
+ Setting[:discovery_clean_facts] = true
240
+ raw = parse_json_fixture('/facts.json')['facts']
241
+ raw.merge!({
242
+ 'delete_me' => "content",
243
+ 'discovery_keep_me' => "content",
244
+ })
245
+ host = Host::Discovered.import_host(raw)
246
+ host.save
247
+ managed = ::ForemanDiscovery::HostConverter.to_managed(host)
248
+ managed.clear_facts
249
+ assert_nil managed.facts_hash['delete_me']
250
+ assert_equal "content", managed.facts_hash['discovery_keep_me']
251
+ end
252
+
253
+ test "all facts are preserved after provisioning" do
254
+ raw = parse_json_fixture('/facts.json')['facts']
255
+ raw.merge!({
256
+ 'keep_me' => "content",
257
+ 'discovery_keep_me' => "content",
258
+ })
259
+ host = Host::Discovered.import_host(raw)
260
+ host.save
261
+ managed = ::ForemanDiscovery::HostConverter.to_managed(host)
262
+ managed.clear_facts
263
+ assert_equal "content", managed.facts_hash['keep_me']
264
+ assert_equal "content", managed.facts_hash['discovery_keep_me']
265
+ end
266
+
171
267
  test "normalization of MAC into a discovered host hostname" do
172
268
  assert_equal Host::Discovered.normalize_string_for_hostname("90:B1:1C:54:D5:82"),"90b11c54d582"
173
269
  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: 5.0.2
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amos Benari
@@ -32,7 +32,7 @@ authors:
32
32
  autorequire:
33
33
  bindir: bin
34
34
  cert_chain: []
35
- date: 2016-03-11 00:00:00.000000000 Z
35
+ date: 2016-07-29 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: deface
@@ -56,152 +56,162 @@ extra_rdoc_files:
56
56
  - LICENSE
57
57
  - README.md
58
58
  files:
59
- - app/mailers/discovered_mailer.rb
60
- - app/controllers/discovery_rules_controller.rb
61
- - app/controllers/discovered_hosts_controller.rb
62
- - app/controllers/concerns/foreman/controller/discovered_extensions.rb
63
- - app/controllers/api/v2/discovery_rules_controller.rb
59
+ - LICENSE
60
+ - README.md
64
61
  - app/controllers/api/v2/discovered_hosts_controller.rb
65
- - app/lib/facter_utils.rb
66
- - app/services/foreman_discovery/node_api/power_service.rb
67
- - app/services/foreman_discovery/node_api/power_legacy_direct_service.rb
68
- - app/services/foreman_discovery/node_api/node_resource.rb
69
- - app/services/foreman_discovery/node_api/power_legacy_proxied_service.rb
70
- - app/services/foreman_discovery/node_api/power.rb
71
- - app/services/foreman_discovery/node_api/inventory.rb
72
- - app/services/foreman_discovery/fact_parser.rb
73
- - app/services/foreman_discovery/host_converter.rb
74
- - app/helpers/discovery_rules_helper.rb
75
- - app/helpers/concerns/foreman_discovery/settings_helper_extensions.rb
62
+ - app/controllers/api/v2/discovery_rules_controller.rb
63
+ - app/controllers/api/v2/fact_values_controller_extensions.rb
64
+ - app/controllers/concerns/foreman/controller/discovered_extensions.rb
65
+ - app/controllers/discovered_hosts_controller.rb
66
+ - app/controllers/discovery_rules_controller.rb
76
67
  - app/helpers/discovered_hosts_helper.rb
77
- - app/overrides/subnet_form_with_discovery_proxy.rb
78
- - app/models/setting/discovered.rb
79
- - app/models/hostgroup_extensions.rb
80
- - app/models/host/discovered.rb
81
- - app/models/host/managed_extensions.rb
82
- - app/models/discovery_rule.rb
68
+ - app/helpers/discovery_rules_helper.rb
69
+ - app/lib/facter_utils.rb
70
+ - app/mailers/discovered_mailer.rb
83
71
  - app/models/concerns/discovery_subnet.rb
72
+ - app/models/concerns/discovery_taxonomy_extensions.rb
73
+ - app/models/concerns/fact_value_extensions.rb
84
74
  - app/models/discovery_attribute_set.rb
85
- - app/views/dashboard/_discovery_widget_host_list.html.erb
75
+ - app/models/discovery_rule.rb
76
+ - app/models/host/discovered.rb
77
+ - app/models/host/managed_extensions.rb
78
+ - app/models/hostgroup_extensions.rb
79
+ - app/models/setting/discovered.rb
80
+ - app/overrides/subnet_form_with_discovery_proxy.rb
81
+ - app/services/foreman_discovery/fact_parser.rb
82
+ - app/services/foreman_discovery/host_converter.rb
83
+ - app/services/foreman_discovery/node_api/inventory.rb
84
+ - app/services/foreman_discovery/node_api/node_resource.rb
85
+ - app/services/foreman_discovery/node_api/power.rb
86
+ - app/services/foreman_discovery/node_api/power_legacy_direct_service.rb
87
+ - app/services/foreman_discovery/node_api/power_legacy_proxied_service.rb
88
+ - app/services/foreman_discovery/node_api/power_service.rb
89
+ - app/views/api/v2/discovered_hosts/base.json.rabl
90
+ - app/views/api/v2/discovered_hosts/index.json.rabl
91
+ - app/views/api/v2/discovered_hosts/main.json.rabl
92
+ - app/views/api/v2/discovered_hosts/show.json.rabl
93
+ - app/views/api/v2/discovered_hosts/update.json.rabl
94
+ - app/views/api/v2/discovery_rules/base.json.rabl
95
+ - app/views/api/v2/discovery_rules/index.json.rabl
96
+ - app/views/api/v2/discovery_rules/main.json.rabl
97
+ - app/views/api/v2/discovery_rules/show.json.rabl
86
98
  - app/views/dashboard/_discovery_widget.html.erb
87
99
  - app/views/dashboard/_discovery_widget_host.html.erb
88
- - app/views/discovery_rules/new.html.erb
89
- - app/views/discovery_rules/edit.html.erb
90
- - app/views/discovery_rules/index.html.erb
91
- - app/views/discovery_rules/_form.html.erb
92
- - app/views/discovered_mailer/_discovered_host.html.erb
93
- - app/views/discovered_mailer/discovered_summary.text.erb
94
- - app/views/discovered_mailer/discovered_summary.html.erb
100
+ - app/views/dashboard/_discovery_widget_host_list.html.erb
95
101
  - app/views/discovered_hosts/_discovered_host.html.erb
102
+ - app/views/discovered_hosts/_discovered_hosts_list.html.erb
96
103
  - app/views/discovered_hosts/_selected_hosts.html.erb
97
- - app/views/discovered_hosts/multiple_destroy.html.erb
98
104
  - app/views/discovered_hosts/index.html.erb
105
+ - app/views/discovered_hosts/multiple_destroy.html.erb
106
+ - app/views/discovered_hosts/select_multiple_location.html.erb
99
107
  - app/views/discovered_hosts/select_multiple_organization.html.erb
100
- - app/views/discovered_hosts/_discovered_hosts_list.html.erb
101
108
  - app/views/discovered_hosts/show.html.erb
102
- - app/views/discovered_hosts/select_multiple_location.html.erb
103
- - app/views/api/v2/discovery_rules/index.json.rabl
104
- - app/views/api/v2/discovery_rules/base.json.rabl
105
- - app/views/api/v2/discovery_rules/main.json.rabl
106
- - app/views/api/v2/discovery_rules/show.json.rabl
107
- - app/views/api/v2/discovered_hosts/index.json.rabl
108
- - app/views/api/v2/discovered_hosts/update.json.rabl
109
- - app/views/api/v2/discovered_hosts/base.json.rabl
110
- - app/views/api/v2/discovered_hosts/main.json.rabl
111
- - app/views/api/v2/discovered_hosts/show.json.rabl
109
+ - app/views/discovered_mailer/_discovered_host.html.erb
110
+ - app/views/discovered_mailer/discovered_summary.html.erb
111
+ - app/views/discovered_mailer/discovered_summary.text.erb
112
+ - app/views/discovery_rules/_form.html.erb
113
+ - app/views/discovery_rules/_template_inline.erb
114
+ - app/views/discovery_rules/edit.html.erb
115
+ - app/views/discovery_rules/index.html.erb
116
+ - app/views/discovery_rules/new.html.erb
117
+ - app/views/foreman_discovery/debian_kexec.erb
112
118
  - app/views/foreman_discovery/redhat_kexec.erb
113
- - extra/build_iso.sh
114
- - extra/wait_for_network.sh
115
- - extra/disk_facts.rb
116
- - extra/generate-authors-file
117
- - extra/discover_host
118
- - extra/foreman_startup.rb
119
- - extra/discovery_init.sh.example
120
- - extra/ovirt-node-build/build_image.sh
121
- - extra/ovirt-node-build/Vagrantfile
122
- - config/routes.rb
123
119
  - config/initializers/discovery_setup.rb
124
- - db/migrate/20150310153859_remove_discovery_attribute_sets_from_managed_hosts.rb
120
+ - config/routes.rb
125
121
  - db/migrate/20141107091416_create_discovery_rules.rb
126
- - db/migrate/20150505111345_remove_leftover_tokens.rb
127
122
  - db/migrate/20141107091417_add_discovery_rule_to_host.rb
128
- - db/migrate/20150302112545_remove_duplicate_tokens_from_hosts.rb
129
- - db/migrate/20151023144501_regenerate_red_hat_kexec.rb
130
- - db/migrate/20150331132115_remove_old_permissions.rb
131
123
  - db/migrate/20141126165451_add_discovery_id_to_subnet.rb
132
124
  - db/migrate/20141223101707_create_discovery_attribute_sets.rb
133
125
  - db/migrate/20141223142759_fill_discovery_attribute_sets_for_existing_hosts.rb
126
+ - db/migrate/20150302112545_remove_duplicate_tokens_from_hosts.rb
127
+ - db/migrate/20150310153859_remove_discovery_attribute_sets_from_managed_hosts.rb
128
+ - db/migrate/20150331132115_remove_old_permissions.rb
129
+ - db/migrate/20150505111345_remove_leftover_tokens.rb
134
130
  - db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
135
131
  - db/migrate/20150714144500_review_discovery_permissions.rb
136
- - db/seeds.d/70_discovery_mail_notification.rb
132
+ - db/migrate/20151023144501_regenerate_red_hat_kexec.rb
133
+ - db/migrate/20160719124942_add_missing_view_permissions.rb
137
134
  - db/seeds.d/50_discovery_templates.rb
138
135
  - db/seeds.d/60_discovery_proxy_feature.rb
136
+ - db/seeds.d/70_discovery_mail_notification.rb
137
+ - extra/build_iso.sh
138
+ - extra/discover_host
139
+ - extra/discovery_init.sh.example
140
+ - extra/disk_facts.rb
141
+ - extra/foreman_startup.rb
142
+ - extra/generate-authors-file
143
+ - extra/ovirt-node-build/Vagrantfile
144
+ - extra/ovirt-node-build/build_image.sh
145
+ - extra/wait_for_network.sh
139
146
  - lib/discovery.rake
140
147
  - lib/foreman_discovery.rb
141
- - lib/foreman_discovery/version.rb
142
148
  - lib/foreman_discovery/engine.rb
143
- - locale/ru/foreman_discovery.po
144
- - locale/ru/foreman_discovery.edit.po
145
- - locale/de/foreman_discovery.po
146
- - locale/de/foreman_discovery.edit.po
147
- - locale/pt_BR/foreman_discovery.po
148
- - locale/pt_BR/foreman_discovery.edit.po
149
- - locale/en_GB/foreman_discovery.po
150
- - locale/en_GB/foreman_discovery.edit.po
151
- - locale/zh_TW/foreman_discovery.po
152
- - locale/zh_TW/foreman_discovery.edit.po
153
- - locale/es/foreman_discovery.po
154
- - locale/es/foreman_discovery.edit.po
155
- - locale/fr/foreman_discovery.po
156
- - locale/fr/foreman_discovery.edit.po
157
- - locale/it/foreman_discovery.po
158
- - locale/it/foreman_discovery.edit.po
159
- - locale/ca/foreman_discovery.po
149
+ - lib/foreman_discovery/version.rb
150
+ - locale/ca/LC_MESSAGES/foreman_discovery.mo
160
151
  - locale/ca/foreman_discovery.edit.po
161
- - locale/ja/foreman_discovery.po
162
- - locale/ja/foreman_discovery.edit.po
163
- - locale/ko/foreman_discovery.po
164
- - locale/ko/foreman_discovery.edit.po
165
- - locale/zh_CN/foreman_discovery.po
166
- - locale/zh_CN/foreman_discovery.edit.po
167
- - locale/gl/foreman_discovery.po
168
- - locale/gl/foreman_discovery.edit.po
169
- - locale/sv_SE/foreman_discovery.po
170
- - locale/sv_SE/foreman_discovery.edit.po
171
- - locale/foreman_discovery.pot
172
- - locale/ru/LC_MESSAGES/foreman_discovery.mo
152
+ - locale/ca/foreman_discovery.po
173
153
  - locale/de/LC_MESSAGES/foreman_discovery.mo
174
- - locale/pt_BR/LC_MESSAGES/foreman_discovery.mo
154
+ - locale/de/foreman_discovery.edit.po
155
+ - locale/de/foreman_discovery.po
156
+ - locale/en/LC_MESSAGES/foreman_discovery.mo
157
+ - locale/en/foreman_discovery.edit.po
158
+ - locale/en/foreman_discovery.po
175
159
  - locale/en_GB/LC_MESSAGES/foreman_discovery.mo
176
- - locale/zh_TW/LC_MESSAGES/foreman_discovery.mo
160
+ - locale/en_GB/foreman_discovery.edit.po
161
+ - locale/en_GB/foreman_discovery.po
177
162
  - locale/es/LC_MESSAGES/foreman_discovery.mo
163
+ - locale/es/foreman_discovery.edit.po
164
+ - locale/es/foreman_discovery.po
165
+ - locale/foreman_discovery.pot
178
166
  - locale/fr/LC_MESSAGES/foreman_discovery.mo
167
+ - locale/fr/foreman_discovery.edit.po
168
+ - locale/fr/foreman_discovery.po
169
+ - locale/gl/LC_MESSAGES/foreman_discovery.mo
170
+ - locale/gl/foreman_discovery.edit.po
171
+ - locale/gl/foreman_discovery.po
179
172
  - locale/it/LC_MESSAGES/foreman_discovery.mo
180
- - locale/messages.mo
181
- - locale/ca/LC_MESSAGES/foreman_discovery.mo
173
+ - locale/it/foreman_discovery.edit.po
174
+ - locale/it/foreman_discovery.po
182
175
  - locale/ja/LC_MESSAGES/foreman_discovery.mo
176
+ - locale/ja/foreman_discovery.edit.po
177
+ - locale/ja/foreman_discovery.po
183
178
  - locale/ko/LC_MESSAGES/foreman_discovery.mo
184
- - locale/zh_CN/LC_MESSAGES/foreman_discovery.mo
185
- - locale/gl/LC_MESSAGES/foreman_discovery.mo
179
+ - locale/ko/foreman_discovery.edit.po
180
+ - locale/ko/foreman_discovery.po
181
+ - locale/messages.mo
182
+ - locale/pt_BR/LC_MESSAGES/foreman_discovery.mo
183
+ - locale/pt_BR/foreman_discovery.edit.po
184
+ - locale/pt_BR/foreman_discovery.po
185
+ - locale/ru/LC_MESSAGES/foreman_discovery.mo
186
+ - locale/ru/foreman_discovery.edit.po
187
+ - locale/ru/foreman_discovery.po
186
188
  - locale/sv_SE/LC_MESSAGES/foreman_discovery.mo
187
- - LICENSE
188
- - README.md
189
- - test/functional/discovery_rules_controller_test.rb
190
- - test/functional/api/v2/discovery_rules_controller_test.rb
189
+ - locale/sv_SE/foreman_discovery.edit.po
190
+ - locale/sv_SE/foreman_discovery.po
191
+ - locale/zh_CN/LC_MESSAGES/foreman_discovery.mo
192
+ - locale/zh_CN/foreman_discovery.edit.po
193
+ - locale/zh_CN/foreman_discovery.po
194
+ - locale/zh_TW/LC_MESSAGES/foreman_discovery.mo
195
+ - locale/zh_TW/foreman_discovery.edit.po
196
+ - locale/zh_TW/foreman_discovery.po
197
+ - test/factories/discovery_rule_related.rb
191
198
  - test/functional/api/v2/discovered_hosts_controller_test.rb
199
+ - test/functional/api/v2/discovery_rules_controller_test.rb
200
+ - test/functional/api/v2/fact_value_extensions_test.rb
192
201
  - test/functional/discovered_hosts_controller_test.rb
193
- - test/factories/discovery_rule_related.rb
202
+ - test/functional/discovery_rules_controller_test.rb
203
+ - test/test_helper.rb
204
+ - test/test_helper_discovery.rb
205
+ - test/test_plugin_helper.rb
194
206
  - test/unit/discovered_extensions_test.rb
195
- - test/unit/fact_parser_test.rb
196
- - test/unit/discovery_attribute_set_test.rb
197
- - test/unit/setting_discovered_test.rb
198
- - test/unit/facts.json
199
207
  - test/unit/discovered_mailer_test.rb
208
+ - test/unit/discovery_attribute_set_test.rb
200
209
  - test/unit/discovery_rule_test.rb
210
+ - test/unit/discovery_taxonomy_extensions_test.rb
211
+ - test/unit/fact_parser_test.rb
212
+ - test/unit/facts.json
201
213
  - test/unit/host_discovered_test.rb
202
- - test/test_helper_discovery.rb
203
- - test/test_plugin_helper.rb
204
- - test/test_helper.rb
214
+ - test/unit/setting_discovered_test.rb
205
215
  homepage: http://github.com/theforeman/foreman_discovery
206
216
  licenses:
207
217
  - GPL-3
@@ -222,13 +232,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
232
  version: '0'
223
233
  requirements: []
224
234
  rubyforge_project:
225
- rubygems_version: 2.0.14
235
+ rubygems_version: 2.5.1
226
236
  signing_key:
227
237
  specification_version: 4
228
238
  summary: MaaS Discovery Plugin for Foreman
229
239
  test_files:
230
240
  - test/functional/discovery_rules_controller_test.rb
231
241
  - test/functional/api/v2/discovery_rules_controller_test.rb
242
+ - test/functional/api/v2/fact_value_extensions_test.rb
232
243
  - test/functional/api/v2/discovered_hosts_controller_test.rb
233
244
  - test/functional/discovered_hosts_controller_test.rb
234
245
  - test/factories/discovery_rule_related.rb
@@ -238,9 +249,9 @@ test_files:
238
249
  - test/unit/setting_discovered_test.rb
239
250
  - test/unit/facts.json
240
251
  - test/unit/discovered_mailer_test.rb
252
+ - test/unit/discovery_taxonomy_extensions_test.rb
241
253
  - test/unit/discovery_rule_test.rb
242
254
  - test/unit/host_discovered_test.rb
243
255
  - test/test_helper_discovery.rb
244
256
  - test/test_plugin_helper.rb
245
257
  - test/test_helper.rb
246
- has_rdoc: