builder/amazon/chroot: upload should os.Create, not os.Open
This commit is contained in:
parent
5feb11cbb7
commit
7ae0f3bafe
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue