foreman_wreckingball 3.4.0 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_wreckingball/hosts_controller.rb +7 -6
- data/app/models/foreman_wreckingball/vmware_hypervisor_facet.rb +4 -7
- data/app/services/foreman_wreckingball/vmware_hypervisor_importer.rb +1 -3
- data/app/views/foreman_wreckingball/hosts/status_managed_hosts_dashboard.html.erb +15 -0
- data/lib/foreman_wreckingball/engine.rb +32 -24
- data/lib/foreman_wreckingball/version.rb +1 -1
- data/lib/tasks/foreman_vmware_checks_tasks.rake +1 -1
- data/test/controllers/foreman_wreckingball/hosts_controller_test.rb +6 -8
- data/test/factories/compute_resource.rb +1 -1
- data/test/factories/foreman_wreckingball_factories.rb +120 -116
- data/test/factories/task.rb +3 -3
- data/test/helpers/foreman_wreckingball/status_helper.rb +1 -1
- data/test/integration/hosts_status_dashboard_test.rb +15 -15
- data/test/models/host_test.rb +2 -2
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5386e48704b4c0837fd34063239ead1bda9c7e2dd72cc60d82c15ac60334fea2
|
4
|
+
data.tar.gz: 4ed751665783de1efb8e25534cc32324f287c4611aa579d031873078b53ff7d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d6df272535f83e43c0889bce9655beb8b01f522269a85ebfbb7e5a6f1d332c407632e295234e12e7dc826897e8cc7eda587a322a57d265b3239ebbda54b4d4f
|
7
|
+
data.tar.gz: 3aea63d70aa6895ba153fdf32c370127ca8ee8a2b22ceb9099b4c8ded6fca3b8315561e4cd78854ec1977b6df73d7dee7e54e5943237de496dfaf1eebec179bd
|
@@ -4,11 +4,7 @@ module ForemanWreckingball
|
|
4
4
|
class HostsController < ::HostsController
|
5
5
|
include ::ForemanTasks::Concerns::Parameters::Triggering
|
6
6
|
include ::HostsHelper
|
7
|
-
|
8
|
-
include ::ApplicationHelper
|
9
|
-
else
|
10
|
-
include ::AuthorizeHelper
|
11
|
-
end
|
7
|
+
include ::AuthorizeHelper
|
12
8
|
|
13
9
|
AJAX_REQUESTS = [:status_hosts].freeze
|
14
10
|
before_action :ajax_request, :only => AJAX_REQUESTS
|
@@ -44,9 +40,14 @@ module ForemanWreckingball
|
|
44
40
|
def status_managed_hosts_dashboard
|
45
41
|
vmware_compute_resources = Foreman::Model::Vmware.unscoped.all
|
46
42
|
|
43
|
+
@errors = {}
|
44
|
+
|
47
45
|
# NOTE The call to ComputeResource#vms may slow things down
|
48
46
|
vms_by_compute_resource_id = vmware_compute_resources.each_with_object({}) do |cr, memo|
|
49
47
|
memo[cr.id] = cr.vms.all
|
48
|
+
rescue StandardError => e
|
49
|
+
@errors[cr.name] = e.message
|
50
|
+
Foreman::Logging.exception("Failed to load VMs from compute resource #{cr.name}", e)
|
50
51
|
end
|
51
52
|
|
52
53
|
# Get all VM UUIDs found in any of the compute resources
|
@@ -178,7 +179,7 @@ module ForemanWreckingball
|
|
178
179
|
|
179
180
|
def action_permission
|
180
181
|
case params[:action]
|
181
|
-
when 'status_dashboard', 'status_hosts'
|
182
|
+
when 'status_dashboard', 'status_hosts', 'status_managed_hosts_dashboard'
|
182
183
|
'view'
|
183
184
|
when 'refresh_status_dashboard'
|
184
185
|
'refresh_vmware_status'
|
@@ -6,14 +6,11 @@ module ForemanWreckingball
|
|
6
6
|
|
7
7
|
validates_lengths_from_database
|
8
8
|
|
9
|
-
validates :host, :
|
9
|
+
validates :host, presence: true, allow_blank: false
|
10
10
|
|
11
|
-
belongs_to :vmware_cluster, :
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
has_many :vmware_facets, :class_name => '::ForemanWreckingball::VmwareFacet', :through => :vmware_clusters,
|
16
|
-
:inverse_of => :vmware_hypervisor_facets
|
11
|
+
belongs_to :vmware_cluster, inverse_of: :vmware_hypervisor_facets, class_name: '::ForemanWreckingball::VmwareCluster'
|
12
|
+
has_one :compute_resource, inverse_of: :vmware_hypervisor_facets, through: :vmware_cluster
|
13
|
+
has_many :vmware_facets, inverse_of: :vmware_hypervisor_facets, through: :vmware_cluster
|
17
14
|
|
18
15
|
serialize :feature_capabilities, JSON
|
19
16
|
|
@@ -11,7 +11,7 @@ module ForemanWreckingball
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def import!
|
14
|
-
logger.info "Can not determine organization for compute resource #{compute_resource}."
|
14
|
+
logger.info "Can not determine organization for compute resource #{compute_resource}."
|
15
15
|
compute_resource.refresh_cache
|
16
16
|
compute_resource.vmware_clusters.each do |cluster|
|
17
17
|
import_hypervisors(cluster)
|
@@ -113,12 +113,10 @@ module ForemanWreckingball
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def organization
|
116
|
-
return unless SETTINGS[:organizations_enabled]
|
117
116
|
compute_resource.organizations.first
|
118
117
|
end
|
119
118
|
|
120
119
|
def location
|
121
|
-
return unless SETTINGS[:locations_enabled]
|
122
120
|
compute_resource.locations.first
|
123
121
|
end
|
124
122
|
|
@@ -18,6 +18,21 @@
|
|
18
18
|
more_than_one_hosts_count: @more_than_one_hosts.count
|
19
19
|
} %>
|
20
20
|
|
21
|
+
<% if @errors.any? %>
|
22
|
+
<div class="alert alert-warning alert-block base alert-dismissable">
|
23
|
+
<%= alert_close %>
|
24
|
+
<h3>
|
25
|
+
<%= icon_text('warning-triangle-o', '', kind: 'pficon') %>
|
26
|
+
<%= _('Failed to load VM data.') %>
|
27
|
+
</h3>
|
28
|
+
<ul>
|
29
|
+
<% @errors.each do |cr, message| %>
|
30
|
+
<li><strong><%= cr %>:</strong> <%= message %></li>
|
31
|
+
<% end %>
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
35
|
+
|
21
36
|
<ul class='nav nav-tabs' data-tabs='tabs'>
|
22
37
|
<li class='active'>
|
23
38
|
<%= content_tag :a, _('List of Hosts not found in vSphere'), href: '#missing_vms_tab', 'data-toggle': 'tab' %>
|
@@ -42,7 +42,19 @@ module ForemanWreckingball
|
|
42
42
|
|
43
43
|
initializer 'foreman_wreckingball.register_plugin', :before => :finisher_hook do |_app|
|
44
44
|
Foreman::Plugin.register :foreman_wreckingball do
|
45
|
-
requires_foreman '>= 1.
|
45
|
+
requires_foreman '>= 1.21'
|
46
|
+
|
47
|
+
automatic_assets(false)
|
48
|
+
precompile_assets(
|
49
|
+
[
|
50
|
+
'foreman_wreckingball/modal.js',
|
51
|
+
'foreman_wreckingball/status_hosts_table.js',
|
52
|
+
'foreman_wreckingball/status_managed_hosts_dashboard.js',
|
53
|
+
'foreman_wreckingball/status_row.js',
|
54
|
+
'foreman_wreckingball/status_hosts_table.css',
|
55
|
+
'foreman_wreckingball/status_managed_hosts_dashboard.css'
|
56
|
+
]
|
57
|
+
)
|
46
58
|
|
47
59
|
security_block :foreman_wreckingball do
|
48
60
|
permission :refresh_vmware_status_hosts, {
|
@@ -76,7 +88,7 @@ module ForemanWreckingball
|
|
76
88
|
|
77
89
|
register_facet(ForemanWreckingball::VmwareHypervisorFacet, :vmware_hypervisor_facet)
|
78
90
|
|
79
|
-
add_controller_action_scope(HostsController, :index) { |base_scope| base_scope.includes(:vmware_facet) }
|
91
|
+
add_controller_action_scope('HostsController', :index) { |base_scope| base_scope.includes(:vmware_facet) }
|
80
92
|
|
81
93
|
# extend host show page
|
82
94
|
extend_page('compute_resources/show') do |context|
|
@@ -97,29 +109,25 @@ module ForemanWreckingball
|
|
97
109
|
|
98
110
|
# Include concerns in this config.to_prepare block
|
99
111
|
config.to_prepare do
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
ForemanWreckingball.fog_vsphere_namespace::Mock.send(:include, FogExtensions::ForemanWreckingball::Vsphere::Mock)
|
117
|
-
end
|
118
|
-
rescue StandardError => e
|
119
|
-
Rails.logger.warn "ForemanWreckingball: skipping engine hook (#{e})\n#{e.backtrace.join("\n")}"
|
112
|
+
::HostStatus.extend(ForemanWreckingball::HostStatusExtensions)
|
113
|
+
|
114
|
+
::ComputeResource.send(:include, ForemanWreckingball::ComputeResourceExtensions)
|
115
|
+
::Foreman::Model::Vmware.send(:include, ForemanWreckingball::VmwareExtensions)
|
116
|
+
::Host::Managed.send(:include, ForemanWreckingball::HostExtensions)
|
117
|
+
::Host::Managed.send(:include, ForemanWreckingball::VmwareFacetHostExtensions)
|
118
|
+
::Host::Managed.send(:include, ForemanWreckingball::VmwareHypervisorFacetHostExtensions)
|
119
|
+
::HostsHelper.send(:include, ForemanWreckingball::HostsHelperExtensions)
|
120
|
+
::User.send(:include, ForemanWreckingball::UserExtensions)
|
121
|
+
::Usergroup.send(:include, ForemanWreckingball::UsergroupExtensions)
|
122
|
+
|
123
|
+
if ForemanWreckingball.fog_patches_required?
|
124
|
+
ForemanWreckingball.fog_vsphere_namespace::Host.send(:include, FogExtensions::ForemanWreckingball::Vsphere::Host)
|
125
|
+
ForemanWreckingball.fog_vsphere_namespace::Server.send(:include, FogExtensions::ForemanWreckingball::Vsphere::Server)
|
126
|
+
ForemanWreckingball.fog_vsphere_namespace::Real.send(:include, FogExtensions::ForemanWreckingball::Vsphere::Real)
|
127
|
+
ForemanWreckingball.fog_vsphere_namespace::Mock.send(:include, FogExtensions::ForemanWreckingball::Vsphere::Mock)
|
120
128
|
end
|
121
|
-
|
122
|
-
|
129
|
+
rescue StandardError => e
|
130
|
+
Rails.logger.warn "ForemanWreckingball: skipping engine hook (#{e})\n#{e.backtrace.join("\n")}"
|
123
131
|
end
|
124
132
|
|
125
133
|
initializer 'foreman_wreckingball.register_gettext', after: :load_config_initializers do |_app|
|
@@ -6,7 +6,7 @@ require 'rake/testtask'
|
|
6
6
|
namespace :foreman_wreckingball do
|
7
7
|
namespace :vmware do
|
8
8
|
desc 'Synchonize VMware compute resource data'
|
9
|
-
task :sync =>
|
9
|
+
task :sync => ['environment', 'dynflow:client'] do
|
10
10
|
User.as_anonymous_admin do
|
11
11
|
::ForemanTasks.sync_task(::Actions::ForemanWreckingball::Vmware::ScheduleVmwareSync)
|
12
12
|
end
|
@@ -4,8 +4,6 @@ require 'test_plugin_helper'
|
|
4
4
|
|
5
5
|
module ForemanWreckingball
|
6
6
|
class HostsControllerTest < ActionController::TestCase
|
7
|
-
include ForemanWreckingball::StatusHelper
|
8
|
-
|
9
7
|
let(:fake_task) { OpenStruct.new(id: 123) }
|
10
8
|
|
11
9
|
setup do
|
@@ -238,7 +236,7 @@ module ForemanWreckingball
|
|
238
236
|
|
239
237
|
test 'remediate selected statuses' do
|
240
238
|
get :schedule_remediate, params: { status_ids: status_ids }, session: set_session_user
|
241
|
-
|
239
|
+
assert_same_elements HostStatus::Status.find(status_ids), assigns['statuses']
|
242
240
|
end
|
243
241
|
end
|
244
242
|
|
@@ -254,7 +252,7 @@ module ForemanWreckingball
|
|
254
252
|
|
255
253
|
test 'remediate all statuses' do
|
256
254
|
get :schedule_remediate, params: { host_association: host_association }, session: set_session_user
|
257
|
-
|
255
|
+
assert_same_elements statuses, assigns['statuses']
|
258
256
|
end
|
259
257
|
|
260
258
|
context 'with owned_only' do
|
@@ -265,7 +263,7 @@ module ForemanWreckingball
|
|
265
263
|
|
266
264
|
test 'remediate only those statuses where the user is the owner of the host' do
|
267
265
|
get :schedule_remediate, params: { host_association: host_association, owned_only: true }, session: set_session_user
|
268
|
-
|
266
|
+
assert_same_elements statuses, assigns['statuses']
|
269
267
|
end
|
270
268
|
end
|
271
269
|
end
|
@@ -296,7 +294,7 @@ module ForemanWreckingball
|
|
296
294
|
|
297
295
|
test 'remediate selected statuses' do
|
298
296
|
post :submit_remediate, params: { status_ids: status_ids }, session: set_session_user
|
299
|
-
|
297
|
+
assert_same_elements HostStatus::Status.find(status_ids), assigns['statuses']
|
300
298
|
end
|
301
299
|
end
|
302
300
|
|
@@ -312,7 +310,7 @@ module ForemanWreckingball
|
|
312
310
|
|
313
311
|
test 'remediate all statuses' do
|
314
312
|
post :submit_remediate, params: { host_association: host_association }, session: set_session_user
|
315
|
-
|
313
|
+
assert_same_elements statuses, assigns['statuses']
|
316
314
|
end
|
317
315
|
|
318
316
|
context 'with owned_only' do
|
@@ -323,7 +321,7 @@ module ForemanWreckingball
|
|
323
321
|
|
324
322
|
test 'remediate only those statuses where the user is the owner of the host' do
|
325
323
|
post :submit_remediate, params: { host_association: host_association, owned_only: true }, session: set_session_user
|
326
|
-
|
324
|
+
assert_same_elements statuses, assigns['statuses']
|
327
325
|
end
|
328
326
|
end
|
329
327
|
end
|
@@ -3,129 +3,133 @@
|
|
3
3
|
FactoryBot.define do
|
4
4
|
factory :vmware_facet, class: 'ForemanWreckingball::VmwareFacet' do
|
5
5
|
vmware_cluster
|
6
|
-
tools_state 2 #:toolsOk
|
7
|
-
power_state 1 #:poweredOn
|
8
|
-
cpus 2
|
9
|
-
corespersocket 1
|
10
|
-
memory_mb 8192
|
11
|
-
guest_id 'rhel6_64Guest'
|
12
|
-
cpu_hot_add false
|
13
|
-
hardware_version 'vmx-10'
|
14
|
-
cpu_features
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
6
|
+
tools_state { 2 } #:toolsOk
|
7
|
+
power_state { 1 } #:poweredOn
|
8
|
+
cpus { 2 }
|
9
|
+
corespersocket { 1 }
|
10
|
+
memory_mb { 8192 }
|
11
|
+
guest_id { 'rhel6_64Guest' }
|
12
|
+
cpu_hot_add { false }
|
13
|
+
hardware_version { 'vmx-10' }
|
14
|
+
cpu_features do
|
15
|
+
[
|
16
|
+
'cpuid.SSE3',
|
17
|
+
'cpuid.PCLMULQDQ',
|
18
|
+
'cpuid.SSSE3',
|
19
|
+
'cpuid.CMPXCHG16B',
|
20
|
+
'cpuid.PCID',
|
21
|
+
'cpuid.SSE41',
|
22
|
+
'cpuid.SSE42',
|
23
|
+
'cpuid.POPCNT',
|
24
|
+
'cpuid.AES',
|
25
|
+
'cpuid.XSAVE',
|
26
|
+
'cpuid.AVX',
|
27
|
+
'cpuid.DS',
|
28
|
+
'cpuid.SS',
|
29
|
+
'cpuid.XCR0_MASTER_SSE',
|
30
|
+
'cpuid.XCR0_MASTER_YMM_H',
|
31
|
+
'cpuid.LAHF64',
|
32
|
+
'cpuid.NX',
|
33
|
+
'cpuid.RDTSCP',
|
34
|
+
'cpuid.LM',
|
35
|
+
'cpuid.Intel'
|
36
|
+
]
|
37
|
+
end
|
36
38
|
host
|
37
39
|
end
|
38
40
|
|
39
41
|
factory :vmware_hypervisor_facet, class: 'ForemanWreckingball::VmwareHypervisorFacet' do
|
40
42
|
host
|
41
43
|
vmware_cluster
|
42
|
-
cpu_cores 18
|
43
|
-
cpu_sockets 1
|
44
|
-
cpu_threads 36
|
45
|
-
memory 412_046_372_864
|
44
|
+
cpu_cores { 18 }
|
45
|
+
cpu_sockets { 1 }
|
46
|
+
cpu_threads { 36 }
|
47
|
+
memory { 412_046_372_864 }
|
46
48
|
uuid { SecureRandom.uuid }
|
47
|
-
feature_capabilities
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
49
|
+
feature_capabilities do
|
50
|
+
[
|
51
|
+
'cpuid.3DNOW',
|
52
|
+
'cpuid.3DNOWPLUS',
|
53
|
+
'cpuid.3DNPREFETCH',
|
54
|
+
'cpuid.ABM',
|
55
|
+
'cpuid.ADX',
|
56
|
+
'cpuid.AES',
|
57
|
+
'cpuid.AMD',
|
58
|
+
'cpuid.AVX',
|
59
|
+
'cpuid.AVX2',
|
60
|
+
'cpuid.BMI1',
|
61
|
+
'cpuid.BMI2',
|
62
|
+
'cpuid.CMPXCHG16B',
|
63
|
+
'cpuid.CR8AVAIL',
|
64
|
+
'cpuid.Cyrix',
|
65
|
+
'cpuid.DS',
|
66
|
+
'cpuid.ENFSTRG',
|
67
|
+
'cpuid.EXTAPICSPC',
|
68
|
+
'cpuid.F16C',
|
69
|
+
'cpuid.FFXSR',
|
70
|
+
'cpuid.FMA',
|
71
|
+
'cpuid.FMA4',
|
72
|
+
'cpuid.FSGSBASE',
|
73
|
+
'cpuid.HLE',
|
74
|
+
'cpuid.IBPB',
|
75
|
+
'cpuid.IBRS',
|
76
|
+
'cpuid.INVPCID',
|
77
|
+
'cpuid.Intel',
|
78
|
+
'cpuid.LAHF64',
|
79
|
+
'cpuid.LM',
|
80
|
+
'cpuid.MISALIGNED_SSE',
|
81
|
+
'cpuid.MMXEXT',
|
82
|
+
'cpuid.MOVBE',
|
83
|
+
'cpuid.MWAIT',
|
84
|
+
'cpuid.NX',
|
85
|
+
'cpuid.PCID',
|
86
|
+
'cpuid.PCLMULQDQ',
|
87
|
+
'cpuid.PDPE1GB',
|
88
|
+
'cpuid.POPCNT',
|
89
|
+
'cpuid.PSN',
|
90
|
+
'cpuid.RDRAND',
|
91
|
+
'cpuid.RDSEED',
|
92
|
+
'cpuid.RDTSCP',
|
93
|
+
'cpuid.RTM',
|
94
|
+
'cpuid.SMAP',
|
95
|
+
'cpuid.SMEP',
|
96
|
+
'cpuid.SS',
|
97
|
+
'cpuid.SSE3',
|
98
|
+
'cpuid.SSE41',
|
99
|
+
'cpuid.SSE42',
|
100
|
+
'cpuid.SSE4A',
|
101
|
+
'cpuid.SSSE3',
|
102
|
+
'cpuid.STIBP',
|
103
|
+
'cpuid.SVM',
|
104
|
+
'cpuid.SVM_DECODE_ASSISTS',
|
105
|
+
'cpuid.SVM_FLUSH_BY_ASID',
|
106
|
+
'cpuid.SVM_NPT',
|
107
|
+
'cpuid.SVM_NRIP',
|
108
|
+
'cpuid.SVM_VMCB_CLEAN',
|
109
|
+
'cpuid.TBM',
|
110
|
+
'cpuid.VIA',
|
111
|
+
'cpuid.VMX',
|
112
|
+
'cpuid.XCR0_MASTER_SSE',
|
113
|
+
'cpuid.XCR0_MASTER_YMM_H',
|
114
|
+
'cpuid.XOP',
|
115
|
+
'cpuid.XSAVE',
|
116
|
+
'cpuid.XSAVEOPT',
|
117
|
+
'hv.capable',
|
118
|
+
'misc.cpuidFaulting',
|
119
|
+
'vpmc.fixctr.0',
|
120
|
+
'vpmc.fixedWidth',
|
121
|
+
'vpmc.genWidth',
|
122
|
+
'vpmc.genctr.0',
|
123
|
+
'vpmc.genctr.1',
|
124
|
+
'vpmc.genctr.2',
|
125
|
+
'vpmc.genctr.3',
|
126
|
+
'vpmc.microarchitecture.ivybridge',
|
127
|
+
'vpmc.numFixedCtrs',
|
128
|
+
'vpmc.numGenCtrs',
|
129
|
+
'vpmc.version',
|
130
|
+
'vt.realmode'
|
131
|
+
]
|
132
|
+
end
|
129
133
|
end
|
130
134
|
|
131
135
|
factory :vmware_cluster, class: 'ForemanWreckingball::VmwareCluster' do
|
data/test/factories/task.rb
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
FactoryBot.modify do
|
4
4
|
factory :some_task do
|
5
5
|
trait :running do
|
6
|
-
state 'running'
|
6
|
+
state { 'running' }
|
7
7
|
end
|
8
8
|
|
9
9
|
trait :stopped do
|
10
|
-
state 'stopped'
|
10
|
+
state { 'stopped' }
|
11
11
|
end
|
12
12
|
|
13
13
|
trait :vmware_sync do
|
14
|
-
label ::Actions::ForemanWreckingball::Vmware::ScheduleVmwareSync.to_s
|
14
|
+
label { ::Actions::ForemanWreckingball::Vmware::ScheduleVmwareSync.to_s }
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -23,28 +23,28 @@ class HostsStatusDashboardTest < ActionDispatch::IntegrationTest
|
|
23
23
|
lists = find_all('div.list-view-pf-main-info')
|
24
24
|
|
25
25
|
# VMWare Tools
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
assert_includes lists[0].text, '1 OK'
|
27
|
+
assert_includes lists[0].text, '0 Warning'
|
28
|
+
assert_includes lists[0].text, '0 Critical'
|
29
29
|
|
30
30
|
# VMWare Operating System
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
assert_includes lists[1].text, '2 OK'
|
32
|
+
assert_includes lists[1].text, '0 Warning'
|
33
|
+
assert_includes lists[1].text, '0 Critical'
|
34
34
|
|
35
35
|
# VMWare CPU Hot Plug
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
assert_includes lists[2].text, '3 OK'
|
37
|
+
assert_includes lists[2].text, '0 Warning'
|
38
|
+
assert_includes lists[2].text, '0 Critical'
|
39
39
|
|
40
40
|
# VMWare Spectre V2
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
assert_includes lists[3].text, '4 OK'
|
42
|
+
assert_includes lists[3].text, '0 Warning'
|
43
|
+
assert_includes lists[3].text, '5 Critical'
|
44
44
|
|
45
45
|
# VMWare Hardware Version
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
assert_includes lists[4].text, '6 OK'
|
47
|
+
assert_includes lists[4].text, '7 Warning'
|
48
|
+
assert_includes lists[4].text, '0 Critical'
|
49
49
|
end
|
50
50
|
end
|
data/test/models/host_test.rb
CHANGED
@@ -24,9 +24,9 @@ class Host::ManagedTest < ActiveSupport::TestCase
|
|
24
24
|
FactoryBot.create(:host, :managed, owner: usergroup_with_user),
|
25
25
|
FactoryBot.create(:host, :managed, owner: FactoryBot.create(:usergroup, usergroups: [usergroup_with_user]))
|
26
26
|
]
|
27
|
-
actual = Host::Managed.owned_by_current_user_or_group_with_current_user
|
27
|
+
actual = Host::Managed.owned_by_current_user_or_group_with_current_user.all
|
28
28
|
|
29
|
-
|
29
|
+
assert_same_elements expected, actual
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_wreckingball
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Goebel
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman-tasks
|
@@ -174,7 +174,7 @@ homepage: https://github.com/dm-drogeriemarkt/foreman_wreckingball
|
|
174
174
|
licenses:
|
175
175
|
- GPL-3.0
|
176
176
|
metadata: {}
|
177
|
-
post_install_message:
|
177
|
+
post_install_message:
|
178
178
|
rdoc_options: []
|
179
179
|
require_paths:
|
180
180
|
- lib
|
@@ -189,9 +189,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
|
-
|
193
|
-
|
194
|
-
signing_key:
|
192
|
+
rubygems_version: 3.1.4
|
193
|
+
signing_key:
|
195
194
|
specification_version: 4
|
196
195
|
summary: Adds status checks of the VMWare VMs to Foreman.
|
197
196
|
test_files:
|