Commit Graph

16 Commits

Author SHA1 Message Date
nywilken 5a54c99e98 post-processor/vagrant-cloud: Update error handling for VagrantCloud API responses
This change updates the underlying type of VagrantCloudErrors.Errors to match the expected errors response type and adds a simple test to verify the parsing of various error responses.
Tests before change

```
--- FAIL: TestVagranCloudErrors (0.00s)
    client_test.go:23: failed to decode error response: json: cannot unmarshal array into Go struct field VagrantCloudErrors.errors of type map[string][]string
    client_test.go:23: failed to decode error response: json: cannot unmarshal array into Go struct field VagrantCloudErrors.errors of type map[string][]string
    client_test.go:26: failed to get expected response; expected "", got "error1. error2"
    client_test.go:23: failed to decode error response: json: cannot unmarshal array into Go struct field VagrantCloudErrors.errors of type map[string][]string
    client_test.go:26: failed to get expected response; expected "", got "message Bad credentials"

```

Test after change
```
--- PASS: TestVagranCloudErrors (0.00s)

```
2020-01-13 11:55:53 -05:00
Brian Fox 331babc2ce allow blank access_token (no auth) for private vagrant box hosting 2019-09-12 12:37:53 +02:00
Davi Vidal a2fd287e56 Ignores SSL verification when on premise vagrant cloud 2019-03-05 10:57:11 +01:00
Megan Marsh c63b54a1e7 move http with proxy call into a helper function 2019-01-25 12:32:52 -08:00
Adrien Delorme 7b10079507 fail if the request could not be created 2018-10-25 10:28:12 +02:00
Adrien Delorme aa2ebec8fd remove duplicate error message from 2018-10-25 10:25:37 +02:00
Adrien Delorme ff4b6d4442 pass vagrant cloud auth token as http header
* stoped using url to pass the auth token and put it in the headers
* added newRequest method to VagrantCloudClient that sets json and auth headesr
* made VagrantCloudClient method pointers to avoid copies
2018-10-24 15:39:53 +02:00
Adrien Delorme 415b886f5b post-processor/vagrant-cloud: validate vagrant cloud auth token doing an auth request 2018-10-24 15:08:08 +02:00
Matthew Hooker 519256feb0
add content-length to file upload 2017-06-12 15:01:19 -07:00
Matthew Hooker a1747c21f7
vagrant-cloud: use less memory when uploading 2017-06-12 11:07:33 -07:00
Emil Hessman 8144c92dd0 post-processor/vagrant-cloud: fix incorrect printf verb types
Fixes the following vet reports:

post-processor/vagrant-cloud/client.go:81: arg resp for printf verb %s of wrong type: *net/http.Response
post-processor/vagrant-cloud/client.go:99: arg resp for printf verb %s of wrong type: *net/http.Response
post-processor/vagrant-cloud/client.go:131: arg resp for printf verb %s of wrong type: *net/http.Response
post-processor/vagrant-cloud/client.go:156: arg resp for printf verb %s of wrong type: *net/http.Response
post-processor/vagrant-cloud/client.go:175: arg resp for printf verb %s of wrong type: *net/http.Response
2015-02-25 05:43:18 +01:00
Jack Pearkes e62e122625 post-processor/vagrant-cloud: fix multi-part corruption 2014-07-21 10:30:51 -04:00
Jack Pearkes 979752cc57 post-processor/vagrant-cloud: remove extra log statement 2014-06-24 16:11:56 -04:00
Jack Pearkes 26abac6999 post-processor/vagrant-cloud: steps for create, upload and release 2014-06-24 15:58:45 -04:00
Jack Pearkes c899051c9c post-processor/vagrant-cloud: use multistep 2014-06-23 15:48:51 -04:00
Jack Pearkes a678362701 post-processor/vagrant-cloud: add api items 2014-06-20 11:20:27 -04:00