Skip to content

Commit

Permalink
*fixed some of the error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
mclark4386 committed Aug 15, 2015
1 parent 0f576cc commit 69bcd2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doproxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def clone_server
shutdown = @client.droplet_actions.shutdown(droplet_id: mdrop.id)

if shutdown
if shutdown.try( :status )
if shutdown['status']
while shutdown.status != "completed"
puts ".."
sleep(2)
Expand All @@ -174,13 +174,13 @@ def clone_server
puts "Creating snapshot.."
snapshot = @client.droplet_actions.snapshot(droplet_id: mdrop.id, name: @clone_image)

if snapshot.try( :id ) and snapshot.id == 'unprocessable_entity'
if snapshot['id'] and snapshot.id == 'unprocessable_entity'
puts snapshot.message
return
end


if snapshot and snapshot.try( :status )
if snapshot and snapshot['status']
while snapshot.status != "completed"
puts ".."
sleep(2)
Expand Down

0 comments on commit 69bcd2c

Please sign in to comment.