foreman_wreckingball 3.4.0 → 3.4.1

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: 6f9adf6349a9a378c18d5be9f632245d0861f63b53ba5ce89b1d72849e0e8c0a
4
- data.tar.gz: '09d87212258ae239f338beed765cf7f9685505e446b458c030e49b33cfc11f27'
3
+ metadata.gz: 5386e48704b4c0837fd34063239ead1bda9c7e2dd72cc60d82c15ac60334fea2
4
+ data.tar.gz: 4ed751665783de1efb8e25534cc32324f287c4611aa579d031873078b53ff7d1
5
5
  SHA512:
6
- metadata.gz: ad1fd61579be1231af29fd18b660e7b8185923f21cef0fad379bede4464eef6fc3cffb1b36da738bf3323918838a97003221a1a23500328ef2f6db9cdf690dc6
7
- data.tar.gz: 2a2afce44f557b74509e3b9833f8ca8b3c95564146e2d16f8c733f0ea62ccc15bcc902da4a510f0b18d7fe76e22617c963aacbf4d073a9af66fa9c647c9bace6
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
- if Gem::Version.new(SETTINGS[:version].short) < Gem::Version.new('1.20')
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, :presence => true, :allow_blank => false
9
+ validates :host, presence: true, allow_blank: false
10
10
 
11
- belongs_to :vmware_cluster, :inverse_of => :vmware_hypervisor_facets, :class_name => 'ForemanWreckingball::VmwareCluster'
12
-
13
- has_one :compute_resource, :inverse_of => :vmware_hypervisor_facets, :through => :vmware_cluster
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}." if SETTINGS[:organizations_enabled]
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.18'
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
- begin
101
- ::HostStatus.extend(ForemanWreckingball::HostStatusExtensions)
102
-
103
- ::ComputeResource.send(:include, ForemanWreckingball::ComputeResourceExtensions)
104
- ::Foreman::Model::Vmware.send(:include, ForemanWreckingball::VmwareExtensions)
105
- ::Host::Managed.send(:include, ForemanWreckingball::HostExtensions)
106
- ::Host::Managed.send(:include, ForemanWreckingball::VmwareFacetHostExtensions)
107
- ::Host::Managed.send(:include, ForemanWreckingball::VmwareHypervisorFacetHostExtensions)
108
- ::HostsHelper.send(:include, ForemanWreckingball::HostsHelperExtensions)
109
- ::User.send(:include, ForemanWreckingball::UserExtensions)
110
- ::Usergroup.send(:include, ForemanWreckingball::UsergroupExtensions)
111
-
112
- if ForemanWreckingball.fog_patches_required?
113
- ForemanWreckingball.fog_vsphere_namespace::Host.send(:include, FogExtensions::ForemanWreckingball::Vsphere::Host)
114
- ForemanWreckingball.fog_vsphere_namespace::Server.send(:include, FogExtensions::ForemanWreckingball::Vsphere::Server)
115
- ForemanWreckingball.fog_vsphere_namespace::Real.send(:include, FogExtensions::ForemanWreckingball::Vsphere::Real)
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
- # load 'foreman_wreckingball/scheduled_jobs.rb'
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|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanWreckingball
4
- VERSION = '3.4.0'
4
+ VERSION = '3.4.1'
5
5
  end
@@ -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 => :environment do
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
- assert_statuses HostStatus::Status.find(status_ids)
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
- assert_statuses statuses
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
- assert_statuses statuses
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
- assert_statuses HostStatus::Status.find(status_ids)
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
- assert_statuses statuses
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
- assert_statuses statuses
324
+ assert_same_elements statuses, assigns['statuses']
327
325
  end
328
326
  end
329
327
  end
@@ -4,7 +4,7 @@ FactoryBot.modify do
4
4
  factory :compute_resource do
5
5
  trait :with_vmware_clusters do
6
6
  transient do
7
- vmware_clusters_count 1
7
+ vmware_clusters_count { 1 }
8
8
  end
9
9
 
10
10
  after(:create) do |compute_resource, evaluator|
@@ -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
- 'cpuid.SSE3',
16
- 'cpuid.PCLMULQDQ',
17
- 'cpuid.SSSE3',
18
- 'cpuid.CMPXCHG16B',
19
- 'cpuid.PCID',
20
- 'cpuid.SSE41',
21
- 'cpuid.SSE42',
22
- 'cpuid.POPCNT',
23
- 'cpuid.AES',
24
- 'cpuid.XSAVE',
25
- 'cpuid.AVX',
26
- 'cpuid.DS',
27
- 'cpuid.SS',
28
- 'cpuid.XCR0_MASTER_SSE',
29
- 'cpuid.XCR0_MASTER_YMM_H',
30
- 'cpuid.LAHF64',
31
- 'cpuid.NX',
32
- 'cpuid.RDTSCP',
33
- 'cpuid.LM',
34
- 'cpuid.Intel'
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
- 'cpuid.3DNOW',
49
- 'cpuid.3DNOWPLUS',
50
- 'cpuid.3DNPREFETCH',
51
- 'cpuid.ABM',
52
- 'cpuid.ADX',
53
- 'cpuid.AES',
54
- 'cpuid.AMD',
55
- 'cpuid.AVX',
56
- 'cpuid.AVX2',
57
- 'cpuid.BMI1',
58
- 'cpuid.BMI2',
59
- 'cpuid.CMPXCHG16B',
60
- 'cpuid.CR8AVAIL',
61
- 'cpuid.Cyrix',
62
- 'cpuid.DS',
63
- 'cpuid.ENFSTRG',
64
- 'cpuid.EXTAPICSPC',
65
- 'cpuid.F16C',
66
- 'cpuid.FFXSR',
67
- 'cpuid.FMA',
68
- 'cpuid.FMA4',
69
- 'cpuid.FSGSBASE',
70
- 'cpuid.HLE',
71
- 'cpuid.IBPB',
72
- 'cpuid.IBRS',
73
- 'cpuid.INVPCID',
74
- 'cpuid.Intel',
75
- 'cpuid.LAHF64',
76
- 'cpuid.LM',
77
- 'cpuid.MISALIGNED_SSE',
78
- 'cpuid.MMXEXT',
79
- 'cpuid.MOVBE',
80
- 'cpuid.MWAIT',
81
- 'cpuid.NX',
82
- 'cpuid.PCID',
83
- 'cpuid.PCLMULQDQ',
84
- 'cpuid.PDPE1GB',
85
- 'cpuid.POPCNT',
86
- 'cpuid.PSN',
87
- 'cpuid.RDRAND',
88
- 'cpuid.RDSEED',
89
- 'cpuid.RDTSCP',
90
- 'cpuid.RTM',
91
- 'cpuid.SMAP',
92
- 'cpuid.SMEP',
93
- 'cpuid.SS',
94
- 'cpuid.SSE3',
95
- 'cpuid.SSE41',
96
- 'cpuid.SSE42',
97
- 'cpuid.SSE4A',
98
- 'cpuid.SSSE3',
99
- 'cpuid.STIBP',
100
- 'cpuid.SVM',
101
- 'cpuid.SVM_DECODE_ASSISTS',
102
- 'cpuid.SVM_FLUSH_BY_ASID',
103
- 'cpuid.SVM_NPT',
104
- 'cpuid.SVM_NRIP',
105
- 'cpuid.SVM_VMCB_CLEAN',
106
- 'cpuid.TBM',
107
- 'cpuid.VIA',
108
- 'cpuid.VMX',
109
- 'cpuid.XCR0_MASTER_SSE',
110
- 'cpuid.XCR0_MASTER_YMM_H',
111
- 'cpuid.XOP',
112
- 'cpuid.XSAVE',
113
- 'cpuid.XSAVEOPT',
114
- 'hv.capable',
115
- 'misc.cpuidFaulting',
116
- 'vpmc.fixctr.0',
117
- 'vpmc.fixedWidth',
118
- 'vpmc.genWidth',
119
- 'vpmc.genctr.0',
120
- 'vpmc.genctr.1',
121
- 'vpmc.genctr.2',
122
- 'vpmc.genctr.3',
123
- 'vpmc.microarchitecture.ivybridge',
124
- 'vpmc.numFixedCtrs',
125
- 'vpmc.numGenCtrs',
126
- 'vpmc.version',
127
- 'vt.realmode'
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
@@ -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
@@ -4,7 +4,7 @@ module ForemanWreckingball
4
4
  module StatusHelper
5
5
  def assert_statuses(expected)
6
6
  actual = request.env['action_controller.instance'].instance_variable_get('@statuses')
7
- assert_equal expected, actual
7
+ assert_same_elements expected, actual
8
8
  end
9
9
  end
10
10
  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
- assert_text lists[0].text, '1 OK'
27
- assert_text lists[0].text, '0 Warning'
28
- assert_text lists[0].text, '0 Critical'
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
- assert_text lists[1].text, '2 OK'
32
- assert_text lists[1].text, '0 Warning'
33
- assert_text lists[1].text, '0 Critical'
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
- assert_text lists[2].text, '3 OK'
37
- assert_text lists[2].text, '0 Warning'
38
- assert_text lists[2].text, '0 Critical'
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
- assert_text lists[3].text, '4 OK'
42
- assert_text lists[3].text, '0 Warning'
43
- assert_text lists[3].text, '5 Critical'
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
- assert_text lists[4].text, '6 OK'
47
- assert_text lists[4].text, '7 Warning'
48
- assert_text lists[4].text, '0 Critical'
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
@@ -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
- assert_equal expected, actual
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.0
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: 2019-04-17 00:00:00.000000000 Z
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
- rubyforge_project:
193
- rubygems_version: 2.7.3
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: