-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #382 from fdupont-redhat/v2v_fix_cleanup_state_mac…
…hine_poweron Fix default cleanup state machine
- Loading branch information
Showing
8 changed files
with
46 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
.../automate/ManageIQ/Transformation/Common.class/__methods__/assesstransformationcleanup.rb
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...utomate/ManageIQ/Transformation/Common.class/__methods__/assesstransformationcleanup.yaml
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
...mate/ManageIQ/Transformation/Infrastructure/VM/Common.class/__methods__/checkpoweredon.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module ManageIQ | ||
module Automate | ||
module Transformation | ||
module Infrastructure | ||
module VM | ||
module Common | ||
class CheckPoweredOn | ||
def initialize(handle = $evm) | ||
@handle = handle | ||
end | ||
|
||
def main | ||
if @handle.root['service_template_transformation_plan_task'].blank? | ||
task = @handle.vmdb(:service_template_transformation_plan_task).find_by(:id => @handle.root['service_template_transformation_plan_task_id']) | ||
vm = task.source if task.present? | ||
else | ||
task = @handle.root['service_template_transformation_plan_task'] | ||
vm = @handle.vmdb(:vm).find_by(:id => task.get_option(:destination_vm_id)) if task.present? | ||
end | ||
return if vm.blank? | ||
@handle.log(:info, "Target VM: #{vm.name} [#{vm.vendor}]") | ||
return if task.get_option(:source_vm_power_state) != 'on' | ||
if vm.power_state != 'on' | ||
@handle.root["ae_result"] = "retry" | ||
@handle.root["ae_retry_interval"] = "15.seconds" | ||
end | ||
rescue => e | ||
@handle.set_state_var(:ae_state_progress, 'message' => e.message) | ||
raise | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
if $PROGRAM_NAME == __FILE__ | ||
ManageIQ::Automate::Transformation::Infrastructure::VM::Common::CheckPoweredOn.new.main | ||
end |
File renamed without changes.
36 changes: 0 additions & 36 deletions
36
...omate/ManageIQ/Transformation/Infrastructure/VM/rhevm.class/__methods__/checkpoweredon.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters