Skip to content

Commit

Permalink
Merge pull request #604 from A-Beck/check-instance-existance-before-g…
Browse files Browse the repository at this point in the history
…etting-status

Check instance exists before getting status during provisioning

(cherry picked from commit 262d51c)

https://bugzilla.redhat.com/show_bug.cgi?id=1830305
  • Loading branch information
agrare authored and simaishi committed May 1, 2020
1 parent 88ac09e commit 0ef7a2c
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -2,7 +2,9 @@ module ManageIQ::Providers::Amazon::CloudManager::Provision::Cloning
def do_clone_task_check(clone_task_ref)
source.with_provider_connection(:sdk_v2 => true) do |ec2|
instance = ec2.instance(clone_task_ref)
status = instance.state.name.to_sym
return false, :pending unless instance.exists?

status = instance.state.name.to_sym
return true if status == :running
return false, status
end
Expand Down

0 comments on commit 0ef7a2c

Please sign in to comment.