Adjust upload limit value and fix error value stored in state bag
This commit is contained in:
parent
9b641c9bfd
commit
3a11820a41
|
@ -9,7 +9,7 @@ import (
|
||||||
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
|
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 {
|
type Upload struct {
|
||||||
UploadPath string `json:"upload_path"`
|
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 err != nil || (resp.StatusCode != 200) {
|
||||||
if resp == nil || resp.Body == nil {
|
if resp == nil || resp.Body == nil {
|
||||||
state.Put("error", "No response from server.")
|
state.Put("error", fmt.Errorf("No response from server."))
|
||||||
} else {
|
} else {
|
||||||
cloudErrors := &VagrantCloudErrors{}
|
cloudErrors := &VagrantCloudErrors{}
|
||||||
err = decodeBody(resp, cloudErrors)
|
err = decodeBody(resp, cloudErrors)
|
||||||
|
|
Loading…
Reference in New Issue