Skip to content

Commit

Permalink
Merge pull request #217 from shanemgrey/patch-1
Browse files Browse the repository at this point in the history
Update shutdown request to API v2
  • Loading branch information
seth-reeser committed Oct 22, 2015
2 parents b89ba28 + 62f7b80 commit 80bb248
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/vagrant-digitalocean/actions/shut_down.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ def initialize(app, env)

def call(env)
# submit shutdown droplet request
result = @client.request("/droplets/#{@machine.id}/shutdown")
result = @client.post("/v2/droplets/#{@machine.id}/actions", {
:type => 'shutdown'
})

# wait for request to complete
env[:ui].info I18n.t('vagrant_digital_ocean.info.shutting_down')
@client.wait_for_event(env, result['event_id'])
@client.wait_for_event(env, result['action']['id'])

# refresh droplet state with provider
Provider.droplet(@machine, :refresh => true)
Expand Down

0 comments on commit 80bb248

Please sign in to comment.