foreman_discovery 24.0.1 → 24.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/discovered_hosts_controller.rb +1 -1
  3. data/app/helpers/discovered_hosts_helper.rb +1 -1
  4. data/app/models/host/discovered.rb +1 -1
  5. data/app/views/discovered_hosts/show.html.erb +23 -21
  6. data/app/views/discovery_rules/_form.html.erb +0 -6
  7. data/db/migrate/20141223142759_fill_discovery_attribute_sets_for_existing_hosts.rb +1 -1
  8. data/db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb +1 -1
  9. data/lib/foreman_discovery/version.rb +1 -1
  10. data/lib/foreman_discovery.rake +1 -5
  11. data/package.json +0 -2
  12. data/test/functional/discovered_hosts_controller_test.rb +1 -1
  13. metadata +13 -32
  14. data/locale/ca/foreman_discovery.edit.po +0 -1122
  15. data/locale/cs_CZ/foreman_discovery.edit.po +0 -1120
  16. data/locale/de/foreman_discovery.edit.po +0 -1129
  17. data/locale/en/foreman_discovery.edit.po +0 -1115
  18. data/locale/en_GB/foreman_discovery.edit.po +0 -1125
  19. data/locale/es/foreman_discovery.edit.po +0 -1130
  20. data/locale/fr/foreman_discovery.edit.po +0 -1126
  21. data/locale/gl/foreman_discovery.edit.po +0 -1120
  22. data/locale/it/foreman_discovery.edit.po +0 -1123
  23. data/locale/ja/foreman_discovery.edit.po +0 -1119
  24. data/locale/ka/foreman_discovery.edit.po +0 -1120
  25. data/locale/ko/foreman_discovery.edit.po +0 -1119
  26. data/locale/pt_BR/foreman_discovery.edit.po +0 -1132
  27. data/locale/ru/foreman_discovery.edit.po +0 -1131
  28. data/locale/sv_SE/foreman_discovery.edit.po +0 -1123
  29. data/locale/zh_CN/foreman_discovery.edit.po +0 -1117
  30. data/locale/zh_TW/foreman_discovery.edit.po +0 -1120
  31. data/test/migrations/20221102075151_migrate_discovery_hostname_and_fact_column_to_array_test.rb.orig +0 -81
@@ -1,81 +0,0 @@
1
- require_relative '../test_plugin_helper'
2
- require ForemanDiscovery::Engine.root.join('db/migrate/20221102075151_migrate_discovery_hostname_and_fact_column_to_array')
3
-
4
- class MigrateDiscoveryHostnameAndFactColumnToArrayTest < ActiveSupport::TestCase
5
- let(:migrations_paths) { ActiveRecord::Migrator.migrations_paths + [ForemanDiscovery::Engine.root.join('db/migrate/').to_s] }
6
-
7
- let(:previous_version) { '20221102065954'.to_i }
8
- let(:current_version) { '20221102075151'.to_i }
9
-
10
- #only load the two migrations we care about (previous one and current one)
11
- let(:migrations) do
12
- [
13
- ActiveRecord::MigrationProxy.new("FixDiscoverySettingsCategoryToDsl", previous_version, "#{ForemanDiscovery::Engine.root}/db/migrate/20221102065954_fix_discovery_settings_category_to_dsl.rb", ""),
14
- ActiveRecord::MigrationProxy.new("MigrateDiscoveryHostnameAndFactColumnToArray", current_version, "#{ForemanDiscovery::Engine.root}/db/migrate/20221102075151_migrate_discovery_hostname_and_fact_column_to_array.rb", "")
15
- ]
16
- end
17
-
18
- def migrate_up
19
- ActiveRecord::Migrator.new(:up, migrations, ActiveRecord::SchemaMigration, current_version).migrate
20
- end
21
-
22
- def setup
23
- ActiveRecord::Migration.suppress_messages do
24
- ActiveRecord::Migrator.new(:down, migrations, ActiveRecord::SchemaMigration, previous_version).migrate
25
- end
26
- end
27
-
28
- def setup_setting(name, value)
29
- setting = Setting.find_or_create_by(name: name)
30
- setting.value = value
31
- setting.save(validate: false)
32
- end
33
-
34
- def test_discovery_hostname_string
35
- setup_setting('discovery_hostname', 'discovery_bootif')
36
- migrate_up
37
- assert_equal ['discovery_bootif'], Setting['discovery_hostname']
38
- end
39
-
40
- def test_discovery_hostname_multistring
41
- setup_setting('discovery_hostname', 'discovery_bootif, fqdn')
42
- migrate_up
43
- assert_equal ['discovery_bootif', 'fqdn'], Setting['discovery_hostname']
44
- end
45
-
46
- def test_discovery_hostname_array
47
- Setting['discovery_hostname'] = ['discovery_bootif']
48
- migrate_up
49
- assert_equal ['discovery_bootif'], Setting['discovery_hostname']
50
- end
51
-
52
- def test_discovery_fact_column_empty
53
- setup_setting('discovery_fact_column', '')
54
- migrate_up
55
- assert_equal [], Setting['discovery_fact_column']
56
- end
57
-
58
- def test_discovery_fact_column_string
59
- setup_setting('discovery_fact_column', 'bios_vendor')
60
- migrate_up
61
- assert_equal ['bios_vendor'], Setting['discovery_fact_column']
62
- end
63
-
64
- def test_discovery_fact_column_multistring
65
- setup_setting('discovery_fact_column', 'bios_vendor, fqdn')
66
- migrate_up
67
- assert_equal ['bios_vendor', 'fqdn'], Setting['discovery_fact_column']
68
- end
69
-
70
- def test_discovery_fact_column_array
71
- Setting['discovery_fact_column'] = ['bios_vendor']
72
- <<<<<<< HEAD
73
- migrate_up
74
- =======
75
-
76
- migrate_up
77
-
78
- >>>>>>> fd3524f (Fix tests for array settings migrations)
79
- assert_equal ['bios_vendor'], Setting['discovery_fact_column']
80
- end
81
- end