]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm/config/groups.go
Add basic support for OpenBSD
[safcm/safcm.git] / cmd / safcm / config / groups.go
index 5af3be09990115740b0ed7f4e9c941b185b87477..d003bddeed1c9e5efdf24db2db57b788dc252b3f 100644 (file)
@@ -60,7 +60,9 @@ func LoadGroups(cfg *Config, hosts *Hosts) (map[string][]string, error) {
                                "%s conflict with pre-defined group %q",
                                errPrefix, name)
                }
-               if hosts.Map[name] != nil {
+               if hosts.Map[name] != nil ||
+                       hosts.Map[strings.TrimSuffix(name,
+                               GroupRemoveSuffix)] != nil {
                        return nil, fmt.Errorf(
                                "%s conflict with existing host",
                                errPrefix)
@@ -95,7 +97,7 @@ func LoadGroups(cfg *Config, hosts *Hosts) (map[string][]string, error) {
                        if hosts.Map[x] != nil || groups[x] != nil {
                                continue
                        }
-                       return nil, fmt.Errorf("%s group %q not found",
+                       return nil, fmt.Errorf("%s member %q not found",
                                errPrefix, x)
                }
        }