ManageIQ/manageiq-providers-vmware

View on GitHub
app/models/manageiq/providers/vmware/cloud_manager/event_catcher.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class ManageIQ::Providers::Vmware::CloudManager::EventCatcher < ::MiqEventCatcher
  def self.settings_name
    :event_catcher_vmware_cloud
  end

  def self.all_valid_ems_in_zone
    # Only run event catcher for those vClouds that have credentials for it.
    # NOTE: ATM it's safest to check if hostname is non-empty string because
    # frontend seems to be inserting empty Authentication and Endpoint even
    # if user opts-in for "None" in AMQP tab.
    super.select do |ems|
      ems.endpoints.any? { |e| e.role == 'amqp' && e.hostname.present? }
    end
  end
end