Skip to content

Commit

Permalink
Merge pull request hashicorp#2258 from mitchellh/b-puppet-manifest-base
Browse files Browse the repository at this point in the history
provisioner/puppet-masterless: only base if manifest is a file [hashicorpGH-1933]
  • Loading branch information
mitchellh committed Jun 17, 2015
2 parents 95d4b84 + 8990c38 commit 5ee02b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion provisioner/puppet-masterless/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,15 @@ 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)
} else {
ui.Say("WARNING: manifest_file should be a file. Use manifest_dir for directories")
}

remoteManifestFile := fmt.Sprintf("%s/%s", remoteManifestsPath, manifestFilename)
if err := comm.Upload(remoteManifestFile, f, nil); err != nil {
return "", err
Expand Down

0 comments on commit 5ee02b0

Please sign in to comment.