Skip to content

Commit

Permalink
Add physical server to constant support policy
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMenezes committed Oct 2, 2017
1 parent f74940f commit 6f644f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MiqEvent < EventStream
SUPPORTED_POLICY_AND_ALERT_CLASSES = [Host, VmOrTemplate, Storage, EmsCluster, ResourcePool,
MiqServer, ExtManagementSystem,
ContainerReplicator, ContainerGroup, ContainerNode, ContainerImage,
MiddlewareServer].freeze
MiddlewareServer, PhysicalServer].freeze

def self.raise_evm_event(target, raw_event, inputs = {}, options = {})
# Target may have been deleted if it's a worker
Expand Down
8 changes: 8 additions & 0 deletions spec/models/miq_event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
end
MiqEvent.raise_evm_job_event(obj, {:type => "scan", :suffix => "complete"}, {})
end

it "physical_server" do
obj = FactoryGirl.create(:physical_server)
expect(MiqEvent).to receive(:raise_evm_event) do |target, raw_event, _inputs|
target == obj && raw_event == "physical_server_shutdown"
end
MiqEvent.raise_evm_job_event(obj, {:type => "shutdown"}, {})
end
end

it "will recognize known events" do
Expand Down

0 comments on commit 6f644f3

Please sign in to comment.