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

blacklisted event names in settings.yml #14647

Merged
merged 2 commits into from
May 9, 2017
Merged
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
4 changes: 0 additions & 4 deletions app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,6 @@ def self.provision_workflow_class
self::ProvisionWorkflow
end

def self.default_blacklisted_event_names
[]
end

# UI methods for determining availability of fields
def supports_port?
false
Expand Down
4 changes: 4 additions & 0 deletions app/models/manageiq/providers/base_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ def refresher
def http_proxy_uri
VMDB::Util.http_proxy_uri(emstype.try(:to_sym)) || VMDB::Util.http_proxy_uri
end

def self.default_blacklisted_event_names
Array(::Settings.ems["ems_#{provider_name.underscore}"].try(:blacklisted_event_names))
end
end
end
1 change: 1 addition & 0 deletions lib/generators/provider/templates/config/settings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
:ems:
:ems_<%= provider_name %>:
:blacklisted_event_names: []
:event_handling:
:event_groups:
:http_proxy:
Expand Down
19 changes: 19 additions & 0 deletions spec/models/manageiq/providers/base_manager_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
describe ManageIQ::Providers::BaseManager do
context ".default_blacklisted_event_names" do
it 'returns an empty array for the base class' do
expect(described_class.default_blacklisted_event_names).to eq([])
end

it 'returns the provider event if configured' do
stub_settings_merge(
:ems => {
:ems_some_provider => {
:blacklisted_event_names => %w(ev1 ev2)
}
}
)
allow(described_class).to receive(:provider_name).and_return('SomeProvider')
expect(described_class.default_blacklisted_event_names).to eq(%w(ev1 ev2))
end
end
end