Skip to content

Commit

Permalink
fix(destroy,halt): remove tasks status polling
Browse files Browse the repository at this point in the history
Since the tasks API endpoint does not exist anymore (kaorimatz/fog-scaleway#7),
polling for the task will result in an error even if the actual task succeeded.

While tasks-related code should be removed from fog-scaleway,
setting async to true for the server.terminate and server.poweroff methods
will bypass this polling.

Fixes kaorimatz#9.
  • Loading branch information
angristan committed Oct 4, 2020
1 parent efde0de commit 2840dad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/vagrant-scaleway/action/destroy_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def call(env)
server.destroy
rescue Fog::Scaleway::Compute::InvalidRequestError => e
if e.message =~ /server should be stopped/
server.terminate(false)
server.terminate(true)
else
raise
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-scaleway/action/stop_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def call(env)
env[:ui].info(I18n.t('vagrant_scaleway.already_status', status: env[:machine].state.id))
else
env[:ui].info(I18n.t('vagrant_scaleway.stopping'))
server.poweroff(false)
server.poweroff(true)
end

@app.call(env)
Expand Down

0 comments on commit 2840dad

Please sign in to comment.