No need to make upload public.

pull/6927/head
Alexander Laamanen 9 years ago committed by Megan Marsh
parent c294e65c36
commit e7e6a80587

@ -148,7 +148,7 @@ func (d *ESX5Driver) Stop(vmxPathLocal string) error {
func (d *ESX5Driver) Register(vmxPathLocal string) error {
vmxPath := filepath.ToSlash(filepath.Join(d.outputDir, filepath.Base(vmxPathLocal)))
if err := d.Upload(vmxPath, vmxPathLocal); err != nil {
if err := d.upload(vmxPath, vmxPathLocal); err != nil {
return err
}
r, err := d.run(nil, "vim-cmd", "solo/registervm", strconv.Quote(vmxPath))
@ -191,7 +191,7 @@ func (d *ESX5Driver) UploadISO(localPath string, checksum string, checksumType s
return finalPath, nil
}
if err := d.Upload(finalPath, localPath); err != nil {
if err := d.upload(finalPath, localPath); err != nil {
return "", err
}
@ -637,7 +637,7 @@ func (d *ESX5Driver) mkdir(path string) error {
return d.sh("mkdir", "-p", strconv.Quote(path))
}
func (d *ESX5Driver) Upload(dst, src string) error {
func (d *ESX5Driver) upload(dst, src string) error {
f, err := os.Open(src)
if err != nil {
return err

@ -24,7 +24,7 @@ type RemoteDriver interface {
IsDestroyed() (bool, error)
// Uploads a local file to remote side.
Upload(dst, src string) error
upload(dst, src string) error
// Download a remote file to a local file.
Download(src, dst string) error

@ -57,7 +57,7 @@ func (d *RemoteDriverMock) IsDestroyed() (bool, error) {
return d.IsDestroyedResult, d.IsDestroyedErr
}
func (d *RemoteDriverMock) Upload(dst, src string) error {
func (d *RemoteDriverMock) upload(dst, src string) error {
return d.UploadErr
}

@ -34,7 +34,7 @@ func (c *StepUploadVMX) Run(_ context.Context, state multistep.StateBag) multist
if ok {
remoteVmxPath := filepath.ToSlash(filepath.Join(fmt.Sprintf("%s", remoteDriver), filepath.Base(vmxPath)))
log.Printf("Uploading VMX file from %s to %s", vmxPath, remoteVmxPath)
if err := remoteDriver.Upload(remoteVmxPath, vmxPath); err != nil {
if err := remoteDriver.upload(remoteVmxPath, vmxPath); err != nil {
state.Put("error", fmt.Errorf("Error writing VMX: %s", err))
return multistep.ActionHalt
}

Loading…
Cancel
Save