foreman_wreckingball 4.0.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/Rakefile +2 -2
- data/app/controllers/foreman_wreckingball/hosts_controller.rb +30 -13
- data/app/helpers/{concerns/foreman_wreckingball/hosts_helper_extensions.rb → foreman_wreckingball/hosts_helper.rb} +1 -1
- data/app/helpers/foreman_wreckingball/hypervisors_helper.rb +2 -1
- data/app/helpers/foreman_wreckingball/statuses_helper.rb +9 -7
- data/app/jobs/update_hosts_vmware_facets.rb +3 -2
- data/app/lib/actions/foreman_wreckingball/bulk_remediate.rb +4 -1
- data/app/lib/actions/foreman_wreckingball/host/remediate_hardware_version.rb +3 -1
- data/app/lib/actions/foreman_wreckingball/host/remediate_spectre_v2.rb +3 -1
- data/app/lib/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem.rb +14 -10
- data/app/lib/actions/foreman_wreckingball/vmware/schedule_vmware_sync.rb +1 -1
- data/app/lib/actions/foreman_wreckingball/vmware/sync_compute_resource.rb +2 -2
- data/app/lib/fog_extensions/foreman_wreckingball/vsphere/host.rb +2 -0
- data/app/lib/fog_extensions/foreman_wreckingball/vsphere/mock.rb +3 -1
- data/app/lib/fog_extensions/foreman_wreckingball/vsphere/real.rb +7 -2
- data/app/lib/fog_extensions/foreman_wreckingball/vsphere/server.rb +2 -0
- data/app/lib/vsphere_os_identifiers/data.yaml +7 -0
- data/app/models/concerns/foreman_wreckingball/compute_resource_extensions.rb +11 -5
- data/app/models/concerns/foreman_wreckingball/host_extensions.rb +9 -4
- data/app/models/concerns/foreman_wreckingball/vmware_facet_host_extensions.rb +42 -11
- data/app/models/concerns/foreman_wreckingball/vmware_hypervisor_facet_host_extensions.rb +6 -2
- data/app/models/foreman_wreckingball/cpu_hot_add_status.rb +1 -1
- data/app/models/foreman_wreckingball/hardware_version_status.rb +1 -1
- data/app/models/foreman_wreckingball/operatingsystem_status.rb +2 -0
- data/app/models/foreman_wreckingball/spectre_v2_status.rb +2 -2
- data/app/models/foreman_wreckingball/vmware_cluster.rb +14 -13
- data/app/models/foreman_wreckingball/vmware_facet.rb +18 -12
- data/app/models/foreman_wreckingball/vmware_hypervisor_facet.rb +3 -1
- data/app/services/foreman_wreckingball/vmware_cluster_importer.rb +7 -4
- data/app/services/foreman_wreckingball/vmware_hypervisor_importer.rb +44 -41
- data/app/views/foreman_wreckingball/hosts/_hosts.json.rabl +2 -2
- data/app/views/foreman_wreckingball/hosts/status_hosts.json.rabl +4 -4
- data/config/environments/production.rb +1 -1
- data/config/routes.rb +3 -2
- data/db/migrate/20181021111543_add_indexes_to_vmware_hypervisor_facets.rb +1 -1
- data/db/migrate/20240201094513_fix_wreckingball_settings_category_to_dsl.rb +13 -0
- data/lib/foreman_wreckingball/engine.rb +46 -52
- data/lib/foreman_wreckingball/scheduled_jobs.rb +1 -1
- data/lib/foreman_wreckingball/version.rb +1 -1
- data/lib/tasks/foreman_vmware_checks_tasks.rake +1 -21
- data/test/actions/foreman_wreckingball/bulk_remediate_test.rb +0 -1
- data/test/actions/foreman_wreckingball/host/refresh_vmware_facet_test.rb +6 -7
- data/test/actions/foreman_wreckingball/host/remediate_hardware_version_test.rb +6 -7
- data/test/actions/foreman_wreckingball/host/remediate_spectre_v2_test.rb +6 -7
- data/test/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem_test.rb +8 -9
- data/test/actions/foreman_wreckingball/vmware/sync_compute_resource_test.rb +2 -2
- data/test/controllers/compute_resources_controller_test.rb +2 -2
- data/test/controllers/foreman_wreckingball/hosts_controller_test.rb +19 -18
- data/test/factories/foreman_wreckingball_factories.rb +10 -10
- data/test/integration/hosts_status_dashboard_test.rb +0 -4
- data/test/integration/hosts_status_managed_hosts_test.rb +4 -5
- data/test/models/compute_resources/vmware_test.rb +1 -1
- data/test/models/foreman_wreckingball/cpu_hot_add_status_test.rb +2 -2
- data/test/models/foreman_wreckingball/hardware_version_status_test.rb +3 -4
- data/test/models/foreman_wreckingball/operatingsystem_status_test.rb +5 -5
- data/test/models/foreman_wreckingball/spectre_v2_status_test.rb +4 -4
- data/test/models/foreman_wreckingball/tools_status_test.rb +2 -2
- data/test/models/foreman_wreckingball/vmware_facet_test.rb +10 -10
- data/test/models/foreman_wreckingball/vmware_hypervisor_facet_test.rb +4 -4
- data/test/models/host_test.rb +54 -52
- data/test/test_plugin_helper.rb +1 -1
- data/test/unit/foreman_wreckingball/access_permissions_test.rb +18 -0
- data/test/unit/foreman_wreckingball/vmware_cluster_importer_test.rb +6 -6
- data/test/unit/foreman_wreckingball/vmware_hypervisor_importer_test.rb +4 -4
- metadata +56 -37
- data/app/models/setting/wreckingball.rb +0 -26
@@ -20,22 +20,22 @@ module ForemanWreckingball
|
|
20
20
|
|
21
21
|
test 'should be true when IBRS is available' do
|
22
22
|
facet.feature_capabilities = ['cpuid.IBRS']
|
23
|
-
|
23
|
+
assert facet.provides_spectre_features?
|
24
24
|
end
|
25
25
|
|
26
26
|
test 'should be true when IBPB is available' do
|
27
27
|
facet.feature_capabilities = ['cpuid.IBPB']
|
28
|
-
|
28
|
+
assert facet.provides_spectre_features?
|
29
29
|
end
|
30
30
|
|
31
31
|
test 'should be true when STIBP is available' do
|
32
32
|
facet.feature_capabilities = ['cpuid.STIBP']
|
33
|
-
|
33
|
+
assert facet.provides_spectre_features?
|
34
34
|
end
|
35
35
|
|
36
36
|
test 'should be false when neither IBRS, IBPB nor STIBP is available' do
|
37
37
|
facet.feature_capabilities = ['cpuid.WHATEVER']
|
38
|
-
|
38
|
+
assert_not facet.provides_spectre_features?
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/test/models/host_test.rb
CHANGED
@@ -2,72 +2,74 @@
|
|
2
2
|
|
3
3
|
require 'test_plugin_helper'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
module Host
|
6
|
+
class ManagedTest < ActiveSupport::TestCase
|
7
|
+
should have_one(:vmware_facet)
|
8
|
+
should have_one(:vmware_cluster)
|
9
|
+
should have_one(:vmware_hypervisor_facet)
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
HostStatus.wreckingball_statuses.each do |status|
|
12
|
+
should have_one(status.host_association)
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
describe '#owned_by_current_user_or_group_with_current_user' do
|
16
|
+
test 'returns only hosts owned by current user' do
|
17
|
+
usergroup_with_user = FactoryBot.create(:usergroup, users: [User.current], usergroups: [FactoryBot.create(:usergroup, users: [])])
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
FactoryBot.create :host, :managed, owner: FactoryBot.create(:user)
|
20
|
+
FactoryBot.create :host, :managed, owner: FactoryBot.create(:usergroup, users: [])
|
21
|
+
FactoryBot.create :host, :managed, owner: usergroup_with_user.usergroups.first
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
expected = [
|
24
|
+
FactoryBot.create(:host, :managed, owner: User.current),
|
25
|
+
FactoryBot.create(:host, :managed, owner: usergroup_with_user),
|
26
|
+
FactoryBot.create(:host, :managed, owner: FactoryBot.create(:usergroup, usergroups: [usergroup_with_user])),
|
27
|
+
]
|
28
|
+
actual = Host::Managed.owned_by_current_user_or_group_with_current_user.all
|
28
29
|
|
29
|
-
|
30
|
+
assert_same_elements expected, actual
|
31
|
+
end
|
30
32
|
end
|
31
|
-
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
context 'scoped search' do
|
35
|
+
setup do
|
36
|
+
@host = FactoryBot.create(:host, :with_vmware_facet)
|
37
|
+
end
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
test 'search by hardware_version' do
|
40
|
+
hosts = Host.search_for('vsphere_hardware_version = vmx-10')
|
41
|
+
assert_includes hosts, @host
|
42
|
+
end
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
test 'search by power_state' do
|
45
|
+
hosts = Host.search_for('vsphere_power_state = poweredOn')
|
46
|
+
assert_includes hosts, @host
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
test 'search by tools_state' do
|
50
|
+
hosts = Host.search_for('vsphere_tools_state = toolsOk')
|
51
|
+
assert_includes hosts, @host
|
52
|
+
end
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
test 'search by guest_id' do
|
55
|
+
hosts = Host.search_for('vsphere_guest_id = rhel6_64Guest')
|
56
|
+
assert_includes hosts, @host
|
57
|
+
end
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
test 'search by cpus' do
|
60
|
+
hosts = Host.search_for('vsphere_cpus = 2')
|
61
|
+
assert_includes hosts, @host
|
62
|
+
end
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
test 'search by corespersocket' do
|
65
|
+
hosts = Host.search_for('vsphere_corespersocket = 1')
|
66
|
+
assert_includes hosts, @host
|
67
|
+
end
|
67
68
|
|
68
|
-
|
69
|
-
|
70
|
-
|
69
|
+
test 'search by memory_mb' do
|
70
|
+
hosts = Host.search_for('vsphere_memory_mb = 8192')
|
71
|
+
assert_includes hosts, @host
|
72
|
+
end
|
71
73
|
end
|
72
74
|
end
|
73
75
|
end
|
data/test/test_plugin_helper.rb
CHANGED
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
5
5
|
require 'database_cleaner'
|
6
6
|
require 'dynflow/testing'
|
7
7
|
|
8
|
-
Dir["#{__dir__}/helpers/foreman_wreckingball/**.rb"].each { |f| require f }
|
8
|
+
Dir["#{__dir__}/helpers/foreman_wreckingball/**.rb"].sort.each { |f| require f }
|
9
9
|
|
10
10
|
# Add plugin to FactoryBot's paths
|
11
11
|
FactoryBot.definition_file_paths << File.join(ForemanTasks::Engine.root, 'test', 'factories')
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'test_plugin_helper'
|
4
|
+
require 'unit/shared/access_permissions_test_base'
|
5
|
+
|
6
|
+
# Permissions are added in AccessPermissions with lists of controllers and
|
7
|
+
# actions that they enable access to. For non-admin users, we need to test
|
8
|
+
# that there are permissions available that cover every controller action, else
|
9
|
+
# it can't be delegated and this will lead to parts of the application that
|
10
|
+
# aren't functional for non-admin users.
|
11
|
+
#
|
12
|
+
# In particular, it's important that actions for AJAX requests are added to
|
13
|
+
# an appropriate permission so views using those requests function.
|
14
|
+
class AccessPermissionsTest < ActiveSupport::TestCase
|
15
|
+
include AccessPermissionsTestBase
|
16
|
+
|
17
|
+
check_routes(ForemanWreckingball::Engine.routes, [])
|
18
|
+
end
|
@@ -10,7 +10,7 @@ module ForemanWreckingball
|
|
10
10
|
end
|
11
11
|
teardown { Fog.unmock! }
|
12
12
|
|
13
|
-
let(:compute_resource) { FactoryBot.create(:vmware_cr, :
|
13
|
+
let(:compute_resource) { FactoryBot.create(:vmware_cr, uuid: 'Solutions') }
|
14
14
|
let(:importer) do
|
15
15
|
VmwareClusterImporter.new(
|
16
16
|
compute_resource: compute_resource
|
@@ -28,10 +28,10 @@ module ForemanWreckingball
|
|
28
28
|
|
29
29
|
test 'removes old clusters without associated records' do
|
30
30
|
old_cluster = FactoryBot.create(:vmware_cluster,
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
:with_hosts,
|
32
|
+
:with_vmware_facets,
|
33
|
+
:with_vmware_hypervisor_facets,
|
34
|
+
compute_resource: compute_resource)
|
35
35
|
|
36
36
|
compute_resource_id = old_cluster.compute_resource.id
|
37
37
|
host_ids = old_cluster.hosts.pluck(:id)
|
@@ -39,7 +39,7 @@ module ForemanWreckingball
|
|
39
39
|
vmware_hypervisor_facet_ids = old_cluster.vmware_hypervisor_facets.pluck(:id)
|
40
40
|
|
41
41
|
importer.import!
|
42
|
-
|
42
|
+
assert_not ForemanWreckingball::VmwareCluster.find_by(id: old_cluster.id)
|
43
43
|
|
44
44
|
assert Foreman::Model::Vmware.find_by(id: compute_resource_id)
|
45
45
|
assert_equal host_ids.count, Host.where(id: host_ids).count
|
@@ -44,7 +44,7 @@ module ForemanWreckingball
|
|
44
44
|
|
45
45
|
test 'imports hypervisors' do
|
46
46
|
importer.import!
|
47
|
-
host = Host::Managed.joins(:vmware_hypervisor_facet).find_by(:
|
47
|
+
host = Host::Managed.joins(:vmware_hypervisor_facet).find_by(name: 'host1.example.com')
|
48
48
|
|
49
49
|
# Test host attributes are set correctly
|
50
50
|
assert_equal 'example.com', host.domain.name
|
@@ -74,11 +74,11 @@ module ForemanWreckingball
|
|
74
74
|
assert_not_nil Host::Managed.find_by(id: host_on_other_cluster.id).vmware_hypervisor_facet
|
75
75
|
end
|
76
76
|
|
77
|
-
test '
|
77
|
+
test 'does not touch hosts created by katello/virt-who' do
|
78
78
|
host = FactoryBot.create(:host, organization: organization)
|
79
|
-
host.update!(:
|
79
|
+
host.update!(name: "virt-who-host1.example.com-#{organization.id}")
|
80
80
|
importer.import!
|
81
|
-
assert_equal
|
81
|
+
assert_equal "virt-who-host1.example.com-#{organization.id}", host.reload.name
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_wreckingball
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Goebel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: foreman_puppet
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: foreman-tasks
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - ">="
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
33
|
+
version: '0'
|
20
34
|
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
38
|
- - ">="
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rdoc
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,19 +53,19 @@ dependencies:
|
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
56
|
+
name: theforeman-rubocop
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
61
|
+
version: 0.1.2
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
68
|
+
version: 0.1.2
|
55
69
|
description: Adds status checks of the VMWare VMs to Foreman.
|
56
70
|
email:
|
57
71
|
- timo.goebel@dm.de
|
@@ -69,7 +83,7 @@ files:
|
|
69
83
|
- app/assets/stylesheets/foreman_wreckingball/status_hosts_table.css.scss
|
70
84
|
- app/assets/stylesheets/foreman_wreckingball/status_managed_hosts_dashboard.css.scss
|
71
85
|
- app/controllers/foreman_wreckingball/hosts_controller.rb
|
72
|
-
- app/helpers/
|
86
|
+
- app/helpers/foreman_wreckingball/hosts_helper.rb
|
73
87
|
- app/helpers/foreman_wreckingball/hypervisors_helper.rb
|
74
88
|
- app/helpers/foreman_wreckingball/statuses_helper.rb
|
75
89
|
- app/jobs/update_hosts_vmware_facets.rb
|
@@ -103,7 +117,6 @@ files:
|
|
103
117
|
- app/models/foreman_wreckingball/vmware_cluster.rb
|
104
118
|
- app/models/foreman_wreckingball/vmware_facet.rb
|
105
119
|
- app/models/foreman_wreckingball/vmware_hypervisor_facet.rb
|
106
|
-
- app/models/setting/wreckingball.rb
|
107
120
|
- app/services/foreman_wreckingball/vmware_cluster_importer.rb
|
108
121
|
- app/services/foreman_wreckingball/vmware_hypervisor_importer.rb
|
109
122
|
- app/views/compute_resources/_hypervisors_tab.html.erb
|
@@ -128,6 +141,7 @@ files:
|
|
128
141
|
- db/migrate/20180614105545_add_feature_capabilities_to_vmware_hypervisor_facets.rb
|
129
142
|
- db/migrate/20181020174609_add_power_state_to_vmware_facets.rb
|
130
143
|
- db/migrate/20181021111543_add_indexes_to_vmware_hypervisor_facets.rb
|
144
|
+
- db/migrate/20240201094513_fix_wreckingball_settings_category_to_dsl.rb
|
131
145
|
- lib/foreman_wreckingball.rb
|
132
146
|
- lib/foreman_wreckingball/engine.rb
|
133
147
|
- lib/foreman_wreckingball/scheduled_jobs.rb
|
@@ -168,6 +182,7 @@ files:
|
|
168
182
|
- test/models/host_test.rb
|
169
183
|
- test/models/usergroup_test.rb
|
170
184
|
- test/test_plugin_helper.rb
|
185
|
+
- test/unit/foreman_wreckingball/access_permissions_test.rb
|
171
186
|
- test/unit/foreman_wreckingball/vmware_cluster_importer_test.rb
|
172
187
|
- test/unit/foreman_wreckingball/vmware_hypervisor_importer_test.rb
|
173
188
|
homepage: https://github.com/dm-drogeriemarkt/foreman_wreckingball
|
@@ -182,48 +197,52 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
197
|
requirements:
|
183
198
|
- - ">="
|
184
199
|
- !ruby/object:Gem::Version
|
185
|
-
version: '
|
200
|
+
version: '2.5'
|
201
|
+
- - "<"
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '4'
|
186
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
205
|
requirements:
|
188
206
|
- - ">="
|
189
207
|
- !ruby/object:Gem::Version
|
190
208
|
version: '0'
|
191
209
|
requirements: []
|
192
|
-
rubygems_version: 3.
|
210
|
+
rubygems_version: 3.4.1
|
193
211
|
signing_key:
|
194
212
|
specification_version: 4
|
195
213
|
summary: Adds status checks of the VMWare VMs to Foreman.
|
196
214
|
test_files:
|
197
|
-
- test/
|
198
|
-
- test/
|
215
|
+
- test/actions/foreman_wreckingball/bulk_remediate_test.rb
|
216
|
+
- test/actions/foreman_wreckingball/host/refresh_vmware_facet_test.rb
|
217
|
+
- test/actions/foreman_wreckingball/host/remediate_hardware_version_test.rb
|
218
|
+
- test/actions/foreman_wreckingball/host/remediate_spectre_v2_test.rb
|
219
|
+
- test/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem_test.rb
|
220
|
+
- test/actions/foreman_wreckingball/vmware/schedule_vmware_sync_test.rb
|
221
|
+
- test/actions/foreman_wreckingball/vmware/sync_compute_resource_test.rb
|
222
|
+
- test/controllers/compute_resources_controller_test.rb
|
223
|
+
- test/controllers/foreman_wreckingball/hosts_controller_test.rb
|
224
|
+
- test/factories/compute_resource.rb
|
225
|
+
- test/factories/foreman_wreckingball_factories.rb
|
226
|
+
- test/factories/host.rb
|
227
|
+
- test/factories/task.rb
|
228
|
+
- test/helpers/foreman_wreckingball/status_helper.rb
|
199
229
|
- test/integration/hosts_status_dashboard_test.rb
|
200
230
|
- test/integration/hosts_status_managed_hosts_test.rb
|
231
|
+
- test/integration_test_plugin_helper.rb
|
201
232
|
- test/models/compute_resource_test.rb
|
202
|
-
- test/models/
|
203
|
-
- test/models/
|
233
|
+
- test/models/compute_resources/vmware_test.rb
|
234
|
+
- test/models/foreman_wreckingball/cpu_hot_add_status_test.rb
|
235
|
+
- test/models/foreman_wreckingball/hardware_version_status_test.rb
|
204
236
|
- test/models/foreman_wreckingball/operatingsystem_status_test.rb
|
205
237
|
- test/models/foreman_wreckingball/spectre_v2_status_test.rb
|
206
|
-
- test/models/foreman_wreckingball/
|
207
|
-
- test/models/foreman_wreckingball/hardware_version_status_test.rb
|
208
|
-
- test/models/foreman_wreckingball/cpu_hot_add_status_test.rb
|
238
|
+
- test/models/foreman_wreckingball/tools_status_test.rb
|
209
239
|
- test/models/foreman_wreckingball/vmware_cluster_test.rb
|
210
240
|
- test/models/foreman_wreckingball/vmware_facet_test.rb
|
211
|
-
- test/models/foreman_wreckingball/
|
241
|
+
- test/models/foreman_wreckingball/vmware_hypervisor_facet_test.rb
|
212
242
|
- test/models/host_status_test.rb
|
213
|
-
- test/models/
|
214
|
-
- test/
|
215
|
-
- test/factories/host.rb
|
216
|
-
- test/factories/foreman_wreckingball_factories.rb
|
217
|
-
- test/factories/task.rb
|
218
|
-
- test/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem_test.rb
|
219
|
-
- test/actions/foreman_wreckingball/host/remediate_hardware_version_test.rb
|
220
|
-
- test/actions/foreman_wreckingball/host/refresh_vmware_facet_test.rb
|
221
|
-
- test/actions/foreman_wreckingball/host/remediate_spectre_v2_test.rb
|
222
|
-
- test/actions/foreman_wreckingball/bulk_remediate_test.rb
|
223
|
-
- test/actions/foreman_wreckingball/vmware/sync_compute_resource_test.rb
|
224
|
-
- test/actions/foreman_wreckingball/vmware/schedule_vmware_sync_test.rb
|
243
|
+
- test/models/host_test.rb
|
244
|
+
- test/models/usergroup_test.rb
|
225
245
|
- test/test_plugin_helper.rb
|
226
|
-
- test/
|
227
|
-
- test/
|
228
|
-
- test/
|
229
|
-
- test/integration_test_plugin_helper.rb
|
246
|
+
- test/unit/foreman_wreckingball/access_permissions_test.rb
|
247
|
+
- test/unit/foreman_wreckingball/vmware_cluster_importer_test.rb
|
248
|
+
- test/unit/foreman_wreckingball/vmware_hypervisor_importer_test.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Setting
|
4
|
-
class Wreckingball < ::Setting
|
5
|
-
def self.default_settings
|
6
|
-
[
|
7
|
-
set('min_vsphere_hardware_version', N_('Minimum required Hardware version for vSphere VMs'), 13, N_('Hardware version'))
|
8
|
-
]
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.load_defaults
|
12
|
-
return unless ActiveRecord::Base.connection.table_exists?('settings')
|
13
|
-
return unless super
|
14
|
-
|
15
|
-
Setting.transaction do
|
16
|
-
default_settings.compact.each { |s| Setting::Wreckingball.create s.update(category: 'Setting::Wreckingball') }
|
17
|
-
end
|
18
|
-
|
19
|
-
true
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.humanized_category
|
23
|
-
N_('Wreckingball')
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|