builder/amazon/chroot: upload should os.Create, not os.Open

This commit is contained in:
Mitchell Hashimoto 2013-07-30 15:14:21 -07:00
parent 5feb11cbb7
commit 7ae0f3bafe
1 changed files with 3 additions and 1 deletions

View File

@ -53,7 +53,8 @@ func (c *Communicator) Start(cmd *packer.RemoteCmd) error {
func (c *Communicator) Upload(dst string, r io.Reader) error { func (c *Communicator) Upload(dst string, r io.Reader) error {
dst = filepath.Join(c.Chroot, dst) dst = filepath.Join(c.Chroot, dst)
f, err := os.Open(dst) log.Printf("Uploading to chroot dir: %s", dst)
f, err := os.Create(dst)
if err != nil { if err != nil {
return err return err
} }
@ -68,6 +69,7 @@ func (c *Communicator) Upload(dst string, r io.Reader) error {
func (c *Communicator) Download(src string, w io.Writer) error { func (c *Communicator) Download(src string, w io.Writer) error {
src = filepath.Join(c.Chroot, src) src = filepath.Join(c.Chroot, src)
log.Printf("Downloading from chroot dir: %s", src)
f, err := os.Open(src) f, err := os.Open(src)
if err != nil { if err != nil {
return err return err