Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions app/models/manageiq/providers/vmware/infra_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Vmware::InfraManager < InfraManager
include VimConnectMixin
include CisConnectMixin

before_save :stop_event_monitor_queue_on_change, :stop_refresh_worker_queue_on_change
before_destroy :stop_event_monitor, :stop_refresh_worker

supports :catalog
Expand Down Expand Up @@ -345,9 +344,14 @@ def validate_remote_console_webmks_support
true
end

def after_update_authentication
def after_update_authentication(changes)
super
stop_refresh_worker_queue_on_credential_change
stop_refresh_worker_queue_on_credential_change(changes)
end

def after_update_endpoints(changes)
super
stop_refresh_worker_queue_on_change(changes)
end

def self.event_monitor_class
Expand Down
33 changes: 0 additions & 33 deletions spec/models/manageiq/providers/vmware/infra_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,39 +239,6 @@
end
end

context "handling changes that may require EventCatcher restart" do
before(:each) do
zone = EvmSpecHelper.local_miq_server.zone
@ems = FactoryBot.create(:ems_vmware, :zone => zone)
end

it "will restart EventCatcher when ipaddress changes" do
@ems.update(:ipaddress => "1.1.1.1")
assert_event_catcher_restart_queued
end

it "will restart EventCatcher when hostname changes" do
@ems.update(:hostname => "something-else")
assert_event_catcher_restart_queued
end

it "will restart EventCatcher when credentials change" do
@ems.update_authentication(:default => {:userid => "new_user_id"})
assert_event_catcher_restart_queued
end

it "will not put multiple restarts of the EventCatcher on the queue" do
@ems.update(:ipaddress => "1.1.1.1")
@ems.update(:hostname => "something else")
assert_event_catcher_restart_queued
end

it "will not restart EventCatcher when name changes" do
@ems.update(:name => "something else")
expect(MiqQueue.count).to eq(0)
end
end

context "catalog types" do
it "#catalog_types" do
ems = FactoryBot.create(:ems_vmware)
Expand Down