provisioner(converge): rename directory to working_directory

This commit is contained in:
Brian Hicks 2016-12-27 16:07:16 -06:00
parent e6ba4c1929
commit de918ac7a7
No known key found for this signature in database
GPG Key ID: FF1F407C0D3C2430
2 changed files with 8 additions and 8 deletions

View File

@ -48,9 +48,9 @@ type ModuleDir struct {
// Module contains information needed to run a module
type Module struct {
Module string `mapstructure:"module"`
Directory string `mapstructure:"directory"`
Params map[string]string `mapstucture:"params"`
Module string `mapstructure:"module"`
WorkingDirectory string `mapstructure:"working_directory"`
Params map[string]string `mapstucture:"params"`
}
// Provisioner for Converge
@ -95,8 +95,8 @@ func (p *Provisioner) Prepare(raws ...interface{}) error {
if module.Module == "" {
return fmt.Errorf("Module (\"module\" key) is required in Converge module #%d", i)
}
if module.Directory == "" {
p.config.Modules[i].Directory = "/tmp"
if module.WorkingDirectory == "" {
p.config.Modules[i].WorkingDirectory = "/tmp"
}
}
@ -194,7 +194,7 @@ func (p *Provisioner) applyModules(ui packer.Ui, comm packer.Communicator) error
cmd := &packer.RemoteCmd{
Command: fmt.Sprintf(
"cd %s && converge apply --local --log-level=WARNING --paramsJSON '%s' %s",
module.Directory,
module.WorkingDirectory,
string(params),
module.Module,
),

View File

@ -46,8 +46,8 @@ func TestProvisionerPrepare(t *testing.T) {
t.Errorf("err: %s", err)
}
if p.config.Modules[0].Directory != "/tmp" {
t.Errorf("unexpected module directory: %s", p.config.Modules[0].Directory)
if p.config.Modules[0].WorkingDirectory != "/tmp" {
t.Errorf("unexpected module directory: %s", p.config.Modules[0].WorkingDirectory)
}
})