diff --git a/command/test-fixtures/cleanup-script/template.json b/command/test-fixtures/cleanup-script/template.json index afc7c5aeb..eea3e7ef0 100644 --- a/command/test-fixtures/cleanup-script/template.json +++ b/command/test-fixtures/cleanup-script/template.json @@ -11,7 +11,7 @@ "inline": ["exit 2"] } ], - "on-error-script": { + "error-cleanup-provisioner": { "type": "shell-local", "inline": ["echo 'rubber ducky'> ducky.txt"] } diff --git a/common/step_provision.go b/common/step_provision.go index 2c13b37d5..07ba39f81 100644 --- a/common/step_provision.go +++ b/common/step_provision.go @@ -81,9 +81,9 @@ func (s *StepProvision) Run(ctx context.Context, state multistep.StateBag) multi } func (s *StepProvision) Cleanup(state multistep.StateBag) { - // We have a "final" provisioner that gets defined by "on-error-script" + // We have a "final" provisioner that gets defined by "error-cleanup-provisioner" // which we only call if there's an error during the provision run and - // the "on-error-script" is defined. + // the "error-cleanup-provisioner" is defined. if _, ok := state.GetOk("error"); ok { s.runWithHook(context.Background(), state, packer.HookCleanupProvision) } diff --git a/template/parse.go b/template/parse.go index 5f8117aa0..02748239c 100644 --- a/template/parse.go +++ b/template/parse.go @@ -29,7 +29,7 @@ type rawTemplate struct { Push map[string]interface{} `json:"push,omitempty"` PostProcessors []interface{} `mapstructure:"post-processors" json:"post-processors,omitempty"` Provisioners []interface{} `json:"provisioners,omitempty"` - CleanupProvisioner interface{} `mapstructure:"on-error-script" json:"on-error-script,omitempty"` + CleanupProvisioner interface{} `mapstructure:"error-cleanup-provisioner" json:"error-cleanup-provisioner,omitempty"` Variables map[string]interface{} `json:"variables,omitempty"` SensitiveVariables []string `mapstructure:"sensitive-variables" json:"sensitive-variables,omitempty"` @@ -244,7 +244,7 @@ func (r *rawTemplate) Template() (*Template, error) { result.Provisioners = append(result.Provisioners, &p) } - // Gather the on-error-script + // Gather the error-cleanup-provisioner if r.CleanupProvisioner != nil { var p Provisioner if err := r.decoder(&p, nil).Decode(r.CleanupProvisioner); err != nil {