config: fix messaging for name symbols

pull/379/head
Mitchell Hashimoto 12 years ago
parent 67d9188a29
commit 9dd7618fce

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

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

Loading…
Cancel
Save