foreman_wreckingball 1.0.0 → 2.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/app/controllers/foreman_wreckingball/hosts_controller.rb +2 -0
- data/app/helpers/concerns/foreman_wreckingball/hosts_helper_extensions.rb +4 -2
- data/app/jobs/update_hosts_vmware_facets.rb +3 -1
- data/app/lib/actions/foreman_wreckingball/host/refresh_vmware_facet.rb +2 -0
- data/app/lib/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem.rb +2 -0
- data/app/lib/actions/foreman_wreckingball/vmware/schedule_vmware_sync.rb +2 -0
- data/app/lib/actions/foreman_wreckingball/vmware/sync_compute_resource.rb +2 -0
- data/app/lib/vsphere_os_identifiers.rb +3 -1
- data/app/lib/vsphere_os_identifiers/os.rb +2 -0
- data/app/models/concerns/foreman_wreckingball/compute_resource_extensions.rb +2 -0
- data/app/models/concerns/foreman_wreckingball/host_extensions.rb +2 -0
- data/app/models/concerns/foreman_wreckingball/vmware_extensions.rb +2 -0
- data/app/models/concerns/foreman_wreckingball/vmware_facet_host_extensions.rb +2 -0
- data/app/models/concerns/foreman_wreckingball/vmware_hypervisor_facet_host_extensions.rb +2 -0
- data/app/models/foreman_wreckingball/cpu_hot_add_status.rb +3 -1
- data/app/models/foreman_wreckingball/operatingsystem_status.rb +3 -1
- data/app/models/foreman_wreckingball/tools_status.rb +2 -0
- data/app/models/foreman_wreckingball/vmware_cluster.rb +3 -1
- data/app/models/foreman_wreckingball/vmware_facet.rb +3 -1
- data/app/models/foreman_wreckingball/vmware_hypervisor_facet.rb +3 -1
- data/app/services/foreman_wreckingball/vmware_cluster_importer.rb +2 -0
- data/app/services/foreman_wreckingball/vmware_hypervisor_importer.rb +2 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20171106155000_create_vmware_facets.rb +3 -1
- data/lib/foreman_wreckingball.rb +2 -0
- data/lib/foreman_wreckingball/engine.rb +4 -2
- data/lib/foreman_wreckingball/scheduled_jobs.rb +2 -0
- data/lib/foreman_wreckingball/version.rb +3 -1
- data/lib/tasks/foreman_vmware_checks_tasks.rake +2 -0
- data/locale/gemspec.rb +2 -0
- data/test/actions/foreman_wreckingball/host/refresh_vmware_facet_test.rb +4 -2
- data/test/actions/foreman_wreckingball/host/remediate_vmware_operatingsystem_test.rb +5 -3
- data/test/actions/foreman_wreckingball/vmware/schedule_vmware_sync_test.rb +2 -0
- data/test/actions/foreman_wreckingball/vmware/sync_compute_resource_test.rb +3 -1
- data/test/controllers/foreman_wreckingball/hosts_controller_test.rb +13 -11
- data/test/factories/compute_resource.rb +3 -1
- data/test/factories/foreman_wreckingball_factories.rb +3 -1
- data/test/factories/host.rb +3 -1
- data/test/models/compute_resource_test.rb +2 -0
- data/test/models/compute_resources/vmware_test.rb +3 -1
- data/test/models/foreman_wreckingball/cpu_hot_add_status_test.rb +6 -4
- data/test/models/foreman_wreckingball/operatingsystem_status_test.rb +5 -3
- data/test/models/foreman_wreckingball/tools_status_test.rb +4 -2
- data/test/models/foreman_wreckingball/vmware_cluster_test.rb +2 -0
- data/test/models/foreman_wreckingball/vmware_facet_test.rb +2 -0
- data/test/models/foreman_wreckingball/vmware_hypervisor_facet_test.rb +2 -0
- data/test/models/host_test.rb +2 -0
- data/test/test_plugin_helper.rb +4 -2
- data/test/unit/foreman_wreckingball/vmware_cluster_importer_test.rb +4 -2
- data/test/unit/foreman_wreckingball/vmware_hypervisor_importer_test.rb +6 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc7a11036e0646a12bade27dd0103e62ded2dfebf765635f25d4183b1ef526ec
|
4
|
+
data.tar.gz: 6f699717b502e437359a62a220c54ae6ed9caaf2d8cc967dea5ba09646ecdd05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fd15f5abf4995dc3818c4f27d6b8e4a7de4a0a23873c705f82b8b194464fa1fb7619220533bf408d1f4c9cf1e64c71b9e523965a245cd7545d650f131707f2b
|
7
|
+
data.tar.gz: c836945e900b536003732099503b532504d1f298a1c59d295a73db0cc4d00d9026c4a36ab1d2f10e222f93b5f6abda2f81965aebbae6b1e2bf0a08a7c83a6cb3
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ForemanWreckingball
|
2
4
|
module HostsHelperExtensions
|
3
5
|
extend ActiveSupport::Concern
|
4
6
|
|
5
7
|
def classes_for_vmware_status_row(counter)
|
6
|
-
return 'pficon-error-circle-o list-view-pf-icon-danger' if (counter[:critical] || 0)
|
7
|
-
return 'pficon-warning-triangle-o list-view-pf-icon-warning' if (counter[:warning] || 0)
|
8
|
+
return 'pficon-error-circle-o list-view-pf-icon-danger' if (counter[:critical] || 0).positive?
|
9
|
+
return 'pficon-warning-triangle-o list-view-pf-icon-warning' if (counter[:warning] || 0).positive?
|
8
10
|
'pficon-ok list-view-pf-icon-success'
|
9
11
|
end
|
10
12
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module VsphereOsIdentifiers
|
2
4
|
def self.data
|
3
5
|
@data ||= load_data
|
@@ -9,7 +11,7 @@ module VsphereOsIdentifiers
|
|
9
11
|
end
|
10
12
|
|
11
13
|
def self.load_data
|
12
|
-
YAML.load_file(File.expand_path('
|
14
|
+
YAML.load_file(File.expand_path('vsphere_os_identifiers/data.yaml', __dir__))
|
13
15
|
end
|
14
16
|
|
15
17
|
def self.all
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ForemanWreckingball
|
2
4
|
class CpuHotAddStatus < ::HostStatus::Status
|
3
5
|
OK = 0
|
@@ -42,7 +44,7 @@ module ForemanWreckingball
|
|
42
44
|
end
|
43
45
|
|
44
46
|
def relevant?(_options = {})
|
45
|
-
host
|
47
|
+
host&.vmware_facet && host.vmware_facet.try(:cpu_hot_add?)
|
46
48
|
end
|
47
49
|
|
48
50
|
def performance_degration?
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ForemanWreckingball
|
2
4
|
class OperatingsystemStatus < ::HostStatus::Status
|
3
5
|
OK = 0
|
@@ -46,7 +48,7 @@ module ForemanWreckingball
|
|
46
48
|
end
|
47
49
|
|
48
50
|
def relevant?(_options = {})
|
49
|
-
host
|
51
|
+
host&.vmware_facet
|
50
52
|
end
|
51
53
|
|
52
54
|
def os_matches_identifier?
|
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ForemanWreckingball
|
2
|
-
class VmwareCluster <
|
4
|
+
class VmwareCluster < ApplicationRecord
|
3
5
|
has_many :vmware_hypervisor_facets,
|
4
6
|
:class_name => '::ForemanWreckingball::VmwareHypervisorFacet',
|
5
7
|
:inverse_of => :vmware_cluster,
|
data/config/routes.rb
CHANGED
data/lib/foreman_wreckingball.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'dynflow'
|
2
4
|
require 'foreman-tasks'
|
3
5
|
|
@@ -23,7 +25,7 @@ module ForemanWreckingball
|
|
23
25
|
|
24
26
|
initializer 'foreman_wreckingball.register_plugin', :before => :finisher_hook do |_app|
|
25
27
|
Foreman::Plugin.register :foreman_wreckingball do
|
26
|
-
requires_foreman '>= 1.
|
28
|
+
requires_foreman '>= 1.17'
|
27
29
|
|
28
30
|
security_block :foreman_wreckingball do
|
29
31
|
permission :refresh_vmware_status_hosts, {
|
@@ -82,7 +84,7 @@ module ForemanWreckingball
|
|
82
84
|
end
|
83
85
|
|
84
86
|
initializer 'foreman_wreckingball.register_gettext', after: :load_config_initializers do |_app|
|
85
|
-
locale_dir = File.join(File.expand_path('
|
87
|
+
locale_dir = File.join(File.expand_path('../..', __dir__), 'locale')
|
86
88
|
locale_domain = 'foreman_wreckingball'
|
87
89
|
Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
|
88
90
|
end
|
data/locale/gemspec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module Actions
|
@@ -13,14 +15,14 @@ module Actions
|
|
13
15
|
teardown { ::Fog.unmock! }
|
14
16
|
|
15
17
|
let(:compute_resource) do
|
16
|
-
cr =
|
18
|
+
cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions')
|
17
19
|
ComputeResource.find(cr.id)
|
18
20
|
end
|
19
21
|
let(:uuid) { '5032c8a5-9c5e-ba7a-3804-832a03e16381' }
|
20
22
|
let(:vm) { compute_resource.find_vm_by_uuid(uuid) }
|
21
23
|
|
22
24
|
let(:host) do
|
23
|
-
|
25
|
+
FactoryBot.create(
|
24
26
|
:host,
|
25
27
|
:managed,
|
26
28
|
:with_vmware_facet,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module Actions
|
@@ -13,14 +15,14 @@ module Actions
|
|
13
15
|
teardown { ::Fog.unmock! }
|
14
16
|
|
15
17
|
let(:compute_resource) do
|
16
|
-
cr =
|
18
|
+
cr = FactoryBot.create(:compute_resource, :vmware, :uuid => 'Solutions')
|
17
19
|
ComputeResource.find(cr.id)
|
18
20
|
end
|
19
21
|
let(:uuid) { '5032c8a5-9c5e-ba7a-3804-832a03e16381' }
|
20
22
|
let(:vm) { compute_resource.find_vm_by_uuid(uuid) }
|
21
23
|
|
22
24
|
let(:operatingsystem) do
|
23
|
-
|
25
|
+
FactoryBot.create(
|
24
26
|
:operatingsystem,
|
25
27
|
architectures: [architectures(:x86_64)],
|
26
28
|
major: 6,
|
@@ -31,7 +33,7 @@ module Actions
|
|
31
33
|
end
|
32
34
|
|
33
35
|
let(:host) do
|
34
|
-
|
36
|
+
FactoryBot.create(
|
35
37
|
:host,
|
36
38
|
:managed,
|
37
39
|
:with_vmware_facet,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module Actions
|
@@ -14,7 +16,7 @@ module Actions
|
|
14
16
|
|
15
17
|
let(:action_class) { ::Actions::ForemanWreckingball::Vmware::SyncComputeResource }
|
16
18
|
let(:compute_resource) do
|
17
|
-
|
19
|
+
FactoryBot.create(
|
18
20
|
:vmware_cr,
|
19
21
|
uuid: 'Solutions'
|
20
22
|
)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module ForemanWreckingball
|
@@ -11,13 +13,13 @@ module ForemanWreckingball
|
|
11
13
|
|
12
14
|
describe '#status_dashboard' do
|
13
15
|
test 'shows an empty status page' do
|
14
|
-
get :status_dashboard,
|
16
|
+
get :status_dashboard, session: set_session_user
|
15
17
|
assert_response :success
|
16
18
|
end
|
17
19
|
|
18
20
|
test 'shows a status page' do
|
19
|
-
|
20
|
-
get :status_dashboard,
|
21
|
+
FactoryBot.create_list(:host, 5, :with_wreckingball_statuses)
|
22
|
+
get :status_dashboard, session: set_session_user
|
21
23
|
assert_response :success
|
22
24
|
end
|
23
25
|
end
|
@@ -25,7 +27,7 @@ module ForemanWreckingball
|
|
25
27
|
describe '#refresh_status_dashboard' do
|
26
28
|
test 'redirects to scheduled task' do
|
27
29
|
ForemanTasks.expects(:async_task).returns(fake_task)
|
28
|
-
put :refresh_status_dashboard,
|
30
|
+
put :refresh_status_dashboard, session: set_session_user
|
29
31
|
assert_response :redirect
|
30
32
|
assert_includes flash[:success], 'successfully scheduled'
|
31
33
|
assert_redirected_to foreman_tasks_task_path(123)
|
@@ -34,32 +36,32 @@ module ForemanWreckingball
|
|
34
36
|
|
35
37
|
describe '#remediate' do
|
36
38
|
let(:host) do
|
37
|
-
|
39
|
+
FactoryBot.create(:host, :with_wreckingball_statuses)
|
38
40
|
end
|
39
41
|
|
40
42
|
test 'redirects to scheduled task' do
|
41
43
|
ForemanTasks.expects(:async_task).returns(fake_task)
|
42
|
-
put :remediate, { status_id: host.vmware_operatingsystem_status_object.id, id: host.id }, set_session_user
|
44
|
+
put :remediate, params: { status_id: host.vmware_operatingsystem_status_object.id, id: host.id }, session: set_session_user
|
43
45
|
assert_response :redirect
|
44
46
|
assert_includes flash[:success], 'successfully scheduled'
|
45
47
|
assert_redirected_to foreman_tasks_task_path(123)
|
46
48
|
end
|
47
49
|
|
48
50
|
test 'raises error when status can not be remediated' do
|
49
|
-
|
51
|
+
FactoryBot.create(:host, :with_wreckingball_statuses)
|
50
52
|
assert_raises Foreman::Exception do
|
51
|
-
put :remediate, { status_id: host.vmware_tools_status_object.id, id: host.id }, set_session_user
|
53
|
+
put :remediate, params: { status_id: host.vmware_tools_status_object.id, id: host.id }, session: set_session_user
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
55
57
|
test 'returns not found when host id is invalid' do
|
56
|
-
put :remediate, { status_id: nil, id: 'invalid' }, set_session_user
|
58
|
+
put :remediate, params: { status_id: nil, id: 'invalid' }, session: set_session_user
|
57
59
|
assert_response :not_found
|
58
60
|
end
|
59
61
|
|
60
62
|
test 'returns not found when status id is invalid' do
|
61
|
-
|
62
|
-
put :remediate, { status_id: 'invalid', id: host.id }, set_session_user
|
63
|
+
FactoryBot.create(:host, :with_wreckingball_statuses)
|
64
|
+
put :remediate, params: { status_id: 'invalid', id: host.id }, session: set_session_user
|
63
65
|
assert_response :not_found
|
64
66
|
end
|
65
67
|
end
|
data/test/factories/host.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
class VmwareTest < ActiveSupport::TestCase
|
4
6
|
setup { Fog.mock! }
|
5
7
|
teardown { Fog.unmock! }
|
6
|
-
let(:compute_resource) {
|
8
|
+
let(:compute_resource) { FactoryBot.build(:vmware_cr, :uuid => 'Solutions') }
|
7
9
|
|
8
10
|
test '#hypervisors returns hosts by cluster' do
|
9
11
|
hosts = compute_resource.hypervisors(cluster_id: 'Solutionscluster').map(&:name)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module ForemanWreckingball
|
@@ -9,7 +11,7 @@ module ForemanWreckingball
|
|
9
11
|
should belong_to(:host)
|
10
12
|
|
11
13
|
let(:host) do
|
12
|
-
|
14
|
+
FactoryBot.create(:host, :managed, :with_vmware_facet)
|
13
15
|
end
|
14
16
|
let(:status) { ForemanWreckingball::CpuHotAddStatus.new(host: host) }
|
15
17
|
|
@@ -67,7 +69,7 @@ module ForemanWreckingball
|
|
67
69
|
end
|
68
70
|
|
69
71
|
test 'no performance degration is indicated' do
|
70
|
-
|
72
|
+
FactoryBot.create(:vmware_hypervisor_facet, cpu_cores: 4, vmware_cluster: host.vmware_facet.vmware_cluster)
|
71
73
|
host.vmware_facet.cpus = 100
|
72
74
|
assert status.performance_degration?
|
73
75
|
end
|
@@ -76,8 +78,8 @@ module ForemanWreckingball
|
|
76
78
|
|
77
79
|
describe '#hypervisor_min_cores' do
|
78
80
|
test 'returns the minimum core count from all hypervisors in the same cluster' do
|
79
|
-
|
80
|
-
|
81
|
+
FactoryBot.create(:vmware_hypervisor_facet, cpu_cores: 4, vmware_cluster: host.vmware_facet.vmware_cluster)
|
82
|
+
FactoryBot.create(:vmware_hypervisor_facet, cpu_cores: 8, vmware_cluster: host.vmware_facet.vmware_cluster)
|
81
83
|
status.host.reload
|
82
84
|
assert_equal 4, status.hypervisor_min_cores
|
83
85
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module ForemanWreckingball
|
@@ -9,7 +11,7 @@ module ForemanWreckingball
|
|
9
11
|
should belong_to(:host)
|
10
12
|
|
11
13
|
let(:operatingsystem) do
|
12
|
-
|
14
|
+
FactoryBot.create(
|
13
15
|
:operatingsystem,
|
14
16
|
architectures: [architectures(:x86_64)],
|
15
17
|
major: 6,
|
@@ -19,7 +21,7 @@ module ForemanWreckingball
|
|
19
21
|
)
|
20
22
|
end
|
21
23
|
let(:host) do
|
22
|
-
|
24
|
+
FactoryBot.create(
|
23
25
|
:host,
|
24
26
|
:managed,
|
25
27
|
:with_vmware_facet,
|
@@ -35,7 +37,7 @@ module ForemanWreckingball
|
|
35
37
|
end
|
36
38
|
|
37
39
|
test '#relevant is only for hosts with a vmware facet' do
|
38
|
-
h =
|
40
|
+
h = FactoryBot.build(:host, :managed)
|
39
41
|
refute ForemanWreckingball::ToolsStatus.new(host: h).relevant?
|
40
42
|
assert status.relevant?
|
41
43
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module ForemanWreckingball
|
@@ -8,7 +10,7 @@ module ForemanWreckingball
|
|
8
10
|
|
9
11
|
should belong_to(:host)
|
10
12
|
|
11
|
-
let(:host) {
|
13
|
+
let(:host) { FactoryBot.create(:host, :with_vmware_facet) }
|
12
14
|
let(:status) { ForemanWreckingball::ToolsStatus.new(host: host) }
|
13
15
|
|
14
16
|
test 'has a host association' do
|
@@ -25,7 +27,7 @@ module ForemanWreckingball
|
|
25
27
|
end
|
26
28
|
|
27
29
|
test '#relevant is only for hosts with a vmware facet' do
|
28
|
-
h =
|
30
|
+
h = FactoryBot.build(:host, :managed)
|
29
31
|
refute ForemanWreckingball::ToolsStatus.new(host: h).relevant?
|
30
32
|
end
|
31
33
|
|
data/test/models/host_test.rb
CHANGED
data/test/test_plugin_helper.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# This calls the main test_helper in Foreman-core
|
2
4
|
require 'test_helper'
|
3
5
|
require 'dynflow/testing'
|
4
6
|
|
5
7
|
# Add plugin to FactoryBot's paths
|
6
|
-
|
7
|
-
|
8
|
+
FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
|
9
|
+
FactoryBot.reload
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module ForemanWreckingball
|
@@ -8,7 +10,7 @@ module ForemanWreckingball
|
|
8
10
|
end
|
9
11
|
teardown { Fog.unmock! }
|
10
12
|
|
11
|
-
let(:compute_resource) {
|
13
|
+
let(:compute_resource) { FactoryBot.create(:vmware_cr, :uuid => 'Solutions') }
|
12
14
|
let(:importer) do
|
13
15
|
VmwareClusterImporter.new(
|
14
16
|
compute_resource: compute_resource
|
@@ -25,7 +27,7 @@ module ForemanWreckingball
|
|
25
27
|
end
|
26
28
|
|
27
29
|
test 'removes old clusters' do
|
28
|
-
old_cluster =
|
30
|
+
old_cluster = FactoryBot.create(:vmware_cluster, compute_resource: compute_resource)
|
29
31
|
importer.import!
|
30
32
|
refute ForemanWreckingball::VmwareCluster.find_by(id: old_cluster.id)
|
31
33
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_plugin_helper'
|
2
4
|
|
3
5
|
module ForemanWreckingball
|
@@ -15,7 +17,7 @@ module ForemanWreckingball
|
|
15
17
|
Location.find_by(name: 'Location 1')
|
16
18
|
end
|
17
19
|
let(:compute_resource) do
|
18
|
-
|
20
|
+
FactoryBot.create(
|
19
21
|
:vmware_cr,
|
20
22
|
uuid: 'Solutions',
|
21
23
|
organizations: [organization],
|
@@ -23,7 +25,7 @@ module ForemanWreckingball
|
|
23
25
|
)
|
24
26
|
end
|
25
27
|
let(:cluster) do
|
26
|
-
|
28
|
+
FactoryBot.create(
|
27
29
|
:vmware_cluster,
|
28
30
|
name: 'Solutionscluster',
|
29
31
|
compute_resource: compute_resource
|
@@ -62,8 +64,8 @@ module ForemanWreckingball
|
|
62
64
|
end
|
63
65
|
|
64
66
|
test 'updates host by katello name' do
|
65
|
-
host =
|
66
|
-
host.
|
67
|
+
host = FactoryBot.create(:host, organization: organization)
|
68
|
+
host.update!(:name => "virt-who-host1.example.com-#{organization.id}")
|
67
69
|
importer.import!
|
68
70
|
assert_equal 'host1.example.com', host.reload.name
|
69
71
|
end
|
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:
|
4
|
+
version: 2.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: 2018-05-
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman-tasks
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.11.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.11.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.54.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.54.0
|
55
55
|
description: Adds status checks of the VMWare VMs to Foreman.
|
56
56
|
email:
|
57
57
|
- timo.goebel@dm.de
|