Skip to content

Commit

Permalink
Merge pull request #8785 from Ladas/check_for_ems_existence_before_st…
Browse files Browse the repository at this point in the history
…opping_event_monitor

Check for EMS existence before stopping event monitor
  • Loading branch information
blomquisg committed May 25, 2016
2 parents c89f460 + 4065040 commit 0f46d9c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/manageiq/providers/openstack/manager_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ def event_monitor_available?
end

def stop_event_monitor_queue_on_change
if authentications.detect{ |x| x.previous_changes.present? } || endpoints.detect{ |x| x.previous_changes.present? }
if event_monitor_class && !self.new_record? && (authentications.detect{ |x| x.previous_changes.present? } ||
endpoints.detect{ |x| x.previous_changes.present? })
_log.info("EMS: [#{name}], Credentials or endpoints have changed, stopping Event Monitor. It will be restarted by the WorkerMonitor.")
stop_event_monitor_queue
network_manager.stop_event_monitor_queue if respond_to?(:network_manager) && network_manager
network_manager.stop_event_monitor_queue if try(:network_manager) && !network_manager.new_record?
end
end

Expand Down

0 comments on commit 0f46d9c

Please sign in to comment.