]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm/config/groups.go
Improve and add comments
[safcm/safcm.git] / cmd / safcm / config / groups.go
index d003bddeed1c9e5efdf24db2db57b788dc252b3f..a1dd83a0164267a0f24a351a74966fd108300323 100644 (file)
@@ -34,7 +34,7 @@ const (
        GroupRemoveSuffix     = GroupSpecialSeparator + "remove"
 )
 
-// Keep in sync with sync_info.go:infoGroupDetectedRegexp
+// Keep in sync with cmd/safcm/sync_info.go:infoGroupDetectedRegexp
 var groupNameRegexp = regexp.MustCompile(`^[a-z0-9_-]+$`)
 
 func LoadGroups(cfg *Config, hosts *Hosts) (map[string][]string, error) {
@@ -86,6 +86,8 @@ func LoadGroups(cfg *Config, hosts *Hosts) (map[string][]string, error) {
                        if x == GroupAll {
                                continue
                        }
+                       // Don't validate against groupNameRegexp because
+                       // hosts have less strict restrictions.
                        if strings.Contains(x, GroupSpecialSeparator) {
                                return nil, fmt.Errorf(
                                        "%s member %q must not contain %q",
@@ -103,8 +105,8 @@ func LoadGroups(cfg *Config, hosts *Hosts) (map[string][]string, error) {
        }
 
        // Sanity check for global configuration
-       for _, x := range cfg.GroupOrder {
-               const errPrefix = "config.yaml: group_order:"
+       for _, x := range cfg.GroupPriority {
+               const errPrefix = "config.yaml: group_priority:"
 
                if x == GroupAll {
                        continue