Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
use new vagrant api endpoint
Browse files Browse the repository at this point in the history
Vagrant Cloud is once again a thing, and with it comes a new API domain
name and an authentication scheme just different enough to be annoying.
Fix up the tests accordingly.
  • Loading branch information
benesch committed Aug 3, 2017
1 parent e86dd0e commit 8ecb0ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ATLAS_BOX_NAME = ENV['VAGRANT_S3AUTH_ATLAS_BOX_NAME'].freeze

class Atlas
BASE_URL = 'https://atlas.hashicorp.com/api/v1'.freeze
BASE_URL = 'https://app.vagrantup.com/api/v1'.freeze

BOX_CREATE_URL = "#{BASE_URL}/boxes".freeze
BOX_RESOURCE_URL = "#{BASE_URL}/box/%<username>s/%<box_name>s".freeze
Expand Down Expand Up @@ -61,9 +61,10 @@ def create_provider(box_name, version, url)

def request(method, url, options)
url_params = (options[:url_params] || {}).merge(username: @username)
data = (options[:data] || {}).merge(access_token: @token)
data = (options[:data] || {})

response = HTTP.request(method, url % url_params, json: data)
url = (url % url_params) + "?access_token=#{@token}"
response = HTTP.request(method, url, json: data)
raise response unless response.code >= 200 && response.code < 400
end

Expand Down

0 comments on commit 8ecb0ab

Please sign in to comment.