]> ruderich.org/simon Gitweb - safcm/safcm.git/commitdiff
config: groups: use "member" in "not found" error message
authorSimon Ruderich <simon@ruderich.org>
Sat, 17 Apr 2021 06:42:52 +0000 (08:42 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sat, 17 Apr 2021 06:42:52 +0000 (08:42 +0200)
"group" was confusing, especially because "group" occurs at the
beginning of the error marking the group where the error occurred.

cmd/safcm/config/groups.go
cmd/safcm/config/groups_test.go

index 386a9a773468d47f9dd4d9779c5df25856e57493..d003bddeed1c9e5efdf24db2db57b788dc252b3f 100644 (file)
@@ -97,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)
                }
        }
index 28aa82f7c9d02be4836b743e5f53528e12b2a4cc..9f5f046385cedf077455fb99d31b93d0075ecdce 100644 (file)
@@ -186,7 +186,7 @@ func TestLoadGroups(t *testing.T) {
                        &Config{},
                        &Hosts{},
                        nil,
-                       fmt.Errorf("groups.yaml: group \"1group2\": group \"does-not-exist\" not found"),
+                       fmt.Errorf("groups.yaml: group \"1group2\": member \"does-not-exist\" not found"),
                },
                {
                        "../testdata/group-invalid-name",