Merge pull request #2992 from hashicorp/d-prevent-destroy-errmsg-tweak

update prevent_destroy error message
This commit is contained in:
Paul Hinze 2015-08-13 10:03:08 -05:00
commit 109393d931
2 changed files with 2 additions and 2 deletions

View File

@ -604,7 +604,7 @@ func TestContext2Plan_preventDestroy_bad(t *testing.T) {
plan, err := ctx.Plan() plan, err := ctx.Plan()
expectedErr := "aws_instance.foo: plan would destroy" expectedErr := "aws_instance.foo: the plan would destroy"
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) { if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s", t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
expectedErr, err, plan) expectedErr, err, plan)

View File

@ -29,4 +29,4 @@ func (n *EvalCheckPreventDestroy) Eval(ctx EvalContext) (interface{}, error) {
return nil, nil return nil, nil
} }
const preventDestroyErrStr = `%s: plan would destroy, but resource has prevent_destroy set. To avoid this error, either disable prevent_destroy, or change your config so the plan does not destroy this resource.` const preventDestroyErrStr = `%s: the plan would destroy this resource, but it currently has lifecycle.prevent_destroy set to true. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or adjust the scope of the plan using the -target flag.`