Commit 742e5568 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

provisioner/puppet-masterless: only base if manifest is a file [GH-1933]

parent 452421b8
......@@ -259,7 +259,13 @@ func (p *Provisioner) uploadManifests(ui packer.Ui, comm packer.Communicator) (s
}
defer f.Close()
manifestFilename := filepath.Base(p.config.ManifestFile)
manifestFilename := p.config.ManifestFile
if fi, err := os.Stat(p.config.ManifestFile); err != nil {
return "", fmt.Errorf("Error inspecting manifest file: %s", err)
} else if !fi.IsDir() {
manifestFilename = filepath.Base(manifestFilename)
}
remoteManifestFile := fmt.Sprintf("%s/%s", remoteManifestsPath, manifestFilename)
if err := comm.Upload(remoteManifestFile, f, nil); err != nil {
return "", err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment