From 3a11820a41ca8df3995fe3e787d60558e37feced Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 24 Mar 2021 10:51:10 -0700 Subject: [PATCH] Adjust upload limit value and fix error value stored in state bag --- post-processor/vagrant-cloud/step_prepare_upload.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post-processor/vagrant-cloud/step_prepare_upload.go b/post-processor/vagrant-cloud/step_prepare_upload.go index b68c8bbe0..07ab7d7de 100644 --- a/post-processor/vagrant-cloud/step_prepare_upload.go +++ b/post-processor/vagrant-cloud/step_prepare_upload.go @@ -9,7 +9,7 @@ import ( packersdk "github.com/hashicorp/packer-plugin-sdk/packer" ) -const VAGRANT_CLOUD_DIRECT_UPLOAD_LIMIT = 5000000000 // Upload limit is 5GB +const VAGRANT_CLOUD_DIRECT_UPLOAD_LIMIT = 5368709120 // Upload limit is 5G type Upload struct { UploadPath string `json:"upload_path"` @@ -52,7 +52,7 @@ func (s *stepPrepareUpload) Run(ctx context.Context, state multistep.StateBag) m if err != nil || (resp.StatusCode != 200) { if resp == nil || resp.Body == nil { - state.Put("error", "No response from server.") + state.Put("error", fmt.Errorf("No response from server.")) } else { cloudErrors := &VagrantCloudErrors{} err = decodeBody(resp, cloudErrors)