config: fix messaging for name symbols

This commit is contained in:
Mitchell Hashimoto 2014-10-08 16:12:53 -07:00
parent 67d9188a29
commit 9dd7618fce
2 changed files with 5 additions and 3 deletions

View File

@ -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()))
}
}

View File

@ -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()
}