Skip to content

Commit

Permalink
Check for EMS new_record before stopping event monitor
Browse files Browse the repository at this point in the history
Check for EMS new_record before stopping event monitor

Fixes BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1336859
  • Loading branch information
Ladas committed May 20, 2016
1 parent 7938a75 commit 4065040
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 @@ -102,10 +102,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 4065040

Please sign in to comment.