Skip to content

Commit

Permalink
Merge pull request #204 from miha-plesko/vm-delete-followup
Browse files Browse the repository at this point in the history
Use utility function vm_powered_on? instead manual comparison
(cherry picked from commit 15f83b5)

https://bugzilla.redhat.com/show_bug.cgi?id=1552683
  • Loading branch information
agrare authored and simaishi committed Mar 8, 2018
1 parent f5dad10 commit 1a31805
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module ManageIQ::Providers::Vmware::CloudManager::Vm::Operations

included do
supports :terminate do
unsupported_reason_add(:terminate, "The VM is powered on") unless current_state == "off"
unsupported_reason_add(:terminate, "The VM is powered on") if vm_powered_on?
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
let(:state) { :standby_guest }
include_examples "Vm operation is not available"
end

context("with :terminate") do
let(:state) { :terminate }
include_examples "Vm operation is available when not powered on"
end
end

context "when destroyed" do
Expand Down

0 comments on commit 1a31805

Please sign in to comment.