Skip to content

Commit

Permalink
Merge pull request #14647 from durandom/blacklisted_event_names
Browse files Browse the repository at this point in the history
blacklisted event names in settings.yml
  • Loading branch information
Fryguy authored May 9, 2017
2 parents 7de713c + 7b2bd75 commit 82637f6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 0 additions & 4 deletions app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,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

0 comments on commit 82637f6

Please sign in to comment.