From 9dd7618fce1ce093abc0e03d4ca56e20360a5a2e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 8 Oct 2014 16:12:53 -0700 Subject: [PATCH] config: fix messaging for name symbols --- config/config.go | 3 ++- terraform/context.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index 6827d58879..5de8114876 100644 --- a/config/config.go +++ b/config/config.go @@ -260,7 +260,8 @@ func (c *Config) Validate() error { // Check that the name matches our regexp if !NameRegexp.Match([]byte(m.Name)) { errs = append(errs, fmt.Errorf( - "%s: module name cannot contain special characters", + "%s: module name can only contain letters, numbers, "+ + "dashes, and underscores", m.Id())) } } diff --git a/terraform/context.go b/terraform/context.go index 30e2b3e019..7f1502fa1e 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -1054,8 +1054,9 @@ func (c *walkContext) validateWalkFn() depgraph.WalkFunc { if !config.NameRegexp.Match([]byte(rn.Config.Name)) { l.Lock() meta.Warns = append(meta.Warns, fmt.Sprintf( - "'%s' warning: name can't contain special characters.\n" + - "this will be an error in Terraform 0.4", + "%s: module name can only contain letters, numbers, "+ + "dashes, and underscores.\n"+ + "This will be an error in Terraform 0.4", rn.Resource.Id)) l.Unlock() }