Skip to content

Commit

Permalink
Merge pull request #915 from kbrock/unsupported_reason_return
Browse files Browse the repository at this point in the history
remove return from supports blocks
  • Loading branch information
jrafanie authored Jul 2, 2024
2 parents 5c67447 + 2855abb commit 6b391ab
Showing 1 changed file with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,22 @@ module ManageIQ::Providers::Vmware::InfraManager::Vm::Operations::Guest

included do
supports :reboot_guest do
reason = unsupported_reason(:control)
return reason if reason

if current_state == "on"
if tools_status == 'toolsNotInstalled'
_("The VM tools is not installed")
end
else
if current_state != "on"
_("The VM is not powered on")
elsif tools_status == 'toolsNotInstalled'
_("The VM tools is not installed")
else
unsupported_reason(:control)
end
end

supports :shutdown_guest do
reason = unsupported_reason(:control)
return reason if reason

if current_state == "on"
if tools_status == 'toolsNotInstalled'
_("The VM tools is not installed")
end
else
if current_state != "on"
_("The VM is not powered on")
elsif tools_status == 'toolsNotInstalled'
_("The VM tools is not installed")
else
unsupported_reason(:control)
end
end

Expand Down

0 comments on commit 6b391ab

Please sign in to comment.