Skip to content

Commit

Permalink
Use utility function supports_terminate? instead manual comparison
Browse files Browse the repository at this point in the history
With this commit we replace manual comparison of status with
utility function. The logic is a bit more bullet-proof now since
we now only prevent VM delete when VM is "ON" while we originally
only allowed delete when VM was "OFF". So effectively we now allow
VM delete even if status is e.g. "unknown" which I think should succeed.

Signed-off-by: Miha Pleško <miha.plesko@xlab.si>
  • Loading branch information
miha-plesko committed Mar 2, 2018
1 parent e1fcf19 commit c0e4ffe
Showing 1 changed file with 1 addition 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

0 comments on commit c0e4ffe

Please sign in to comment.