Fix timestamp interpolation in created file name

This commit attempts to fix the timestamp-related part of #4885 by using the logic found in the analogous virtualbox implementation. In essence, it applies the solution from commit 93bb0d8 to the vmx case.
This commit is contained in:
Matthias Merdes 2017-08-23 13:04:42 +02:00 committed by GitHub
parent 1de4be0483
commit c8d09b5152
1 changed files with 2 additions and 1 deletions

View File

@ -51,7 +51,8 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
// Defaults
if c.VMName == "" {
c.VMName = fmt.Sprintf("packer-%s-{{timestamp}}", c.PackerBuildName)
c.VMName = fmt.Sprintf(
"packer-%s-%d", c.PackerBuildName, interpolate.InitTime.Unix())
}
// Prepare the errors