Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for EMS existence before stopping event monitor #8785

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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