get chroot command from proper place.
This commit is contained in:
parent
6d4b834f61
commit
308b148bb4
|
@ -21,7 +21,6 @@ type StepCopyFiles struct {
|
||||||
func (s *StepCopyFiles) Run(state multistep.StateBag) multistep.StepAction {
|
func (s *StepCopyFiles) Run(state multistep.StateBag) multistep.StepAction {
|
||||||
config := state.Get("config").(*Config)
|
config := state.Get("config").(*Config)
|
||||||
mountPath := state.Get("mount_path").(string)
|
mountPath := state.Get("mount_path").(string)
|
||||||
copyCmd := state.Get("copy_command").(string)
|
|
||||||
ui := state.Get("ui").(packer.Ui)
|
ui := state.Get("ui").(packer.Ui)
|
||||||
|
|
||||||
s.files = make([]string, 0, len(config.CopyFiles))
|
s.files = make([]string, 0, len(config.CopyFiles))
|
||||||
|
@ -32,7 +31,7 @@ func (s *StepCopyFiles) Run(state multistep.StateBag) multistep.StepAction {
|
||||||
chrootPath := filepath.Join(mountPath, path)
|
chrootPath := filepath.Join(mountPath, path)
|
||||||
log.Printf("Copying '%s' to '%s'", path, chrootPath)
|
log.Printf("Copying '%s' to '%s'", path, chrootPath)
|
||||||
|
|
||||||
if err := copySingle(chrootPath, path, copyCmd); err != nil {
|
if err := copySingle(chrootPath, path, config.ChrootCommand); err != nil {
|
||||||
err := fmt.Errorf("Error copying file: %s", err)
|
err := fmt.Errorf("Error copying file: %s", err)
|
||||||
state.Put("error", err)
|
state.Put("error", err)
|
||||||
ui.Error(err.Error())
|
ui.Error(err.Error())
|
||||||
|
|
Loading…
Reference in New Issue