]> ruderich.org/simon Gitweb - safcm/safcm.git/commitdiff
sync: remove duplicate "priority" from group priority log message
authorSimon Ruderich <simon@ruderich.org>
Wed, 28 Apr 2021 05:57:52 +0000 (07:57 +0200)
committerSimon Ruderich <simon@ruderich.org>
Wed, 28 Apr 2021 05:57:52 +0000 (07:57 +0200)
Now that the configuration option is called "group_priority" we can
remove the second "priority" and spell out "descending" (takes less
space than before).

cmd/safcm/main_sync_test.go
cmd/safcm/sync_sync.go
cmd/safcm/sync_sync_test.go

index f58dabf96256d814583e8e4ac1481a9b591fbc03..ad4acac9c823f2da1a68eb7a6d189b19dc233747 100644 (file)
@@ -110,7 +110,7 @@ func TestSyncSshEndToEnd(t *testing.T) {
                        []string{"-log", "verbose", "no-settings.example.org"},
                        `<LOG>[info]    [no-settings.example.org] remote helper upload in progress
 <LOG>[verbose] [no-settings.example.org] host groups: all <DET> <DET> no-settings.example.org
                        []string{"-log", "verbose", "no-settings.example.org"},
                        `<LOG>[info]    [no-settings.example.org] remote helper upload in progress
 <LOG>[verbose] [no-settings.example.org] host groups: all <DET> <DET> no-settings.example.org
-<LOG>[verbose] [no-settings.example.org] host group priorities (desc. priority): no-settings.example.org
+<LOG>[verbose] [no-settings.example.org] host group priorities (descending): no-settings.example.org
 <LOG>[info]    [no-settings.example.org] no changes
 `,
                        nil,
 <LOG>[info]    [no-settings.example.org] no changes
 `,
                        nil,
@@ -121,7 +121,7 @@ func TestSyncSshEndToEnd(t *testing.T) {
                        []string{"-log", "debug2", "no-settings.example.org"},
                        `<LOG>[info]    [no-settings.example.org] remote helper upload in progress
 <LOG>[verbose] [no-settings.example.org] host groups: all <DET> <DET> no-settings.example.org
                        []string{"-log", "debug2", "no-settings.example.org"},
                        `<LOG>[info]    [no-settings.example.org] remote helper upload in progress
 <LOG>[verbose] [no-settings.example.org] host groups: all <DET> <DET> no-settings.example.org
-<LOG>[verbose] [no-settings.example.org] host group priorities (desc. priority): no-settings.example.org
+<LOG>[verbose] [no-settings.example.org] host group priorities (descending): no-settings.example.org
 <LOG>[info]    [no-settings.example.org] no changes
 `,
                        nil,
 <LOG>[info]    [no-settings.example.org] no changes
 `,
                        nil,
index f07d07f68f4e901c57d78239f78c27cc21bd5bd5..6977edd584406247c9df8ebbd24d75ecfba5a31c 100644 (file)
@@ -85,7 +85,7 @@ func (s *Sync) hostSyncReq(detectedGroups []string) (
                        b := priorities[j]
                        return groupPriority[a] > groupPriority[b]
                })
                        b := priorities[j]
                        return groupPriority[a] > groupPriority[b]
                })
-               s.logVerbosef("host group priorities (desc. priority): %v",
+               s.logVerbosef("host group priorities (descending): %v",
                        strings.Join(priorities, " "))
        }
 
                        strings.Join(priorities, " "))
        }
 
index b8a53a40889d735531cd0079431ca88ad74e00bc..f0e7524e8186a6d803c6d8e5ac326e95f722a93e 100644 (file)
@@ -149,7 +149,7 @@ func TestHostSyncReq(t *testing.T) {
                        },
                        []string{
                                "host1.example.org: <nil> 3 host groups: all group group3 host1.example.org remove",
                        },
                        []string{
                                "host1.example.org: <nil> 3 host groups: all group group3 host1.example.org remove",
-                               "host1.example.org: <nil> 3 host group priorities (desc. priority): host1.example.org",
+                               "host1.example.org: <nil> 3 host group priorities (descending): host1.example.org",
                        },
                        nil,
                },
                        },
                        nil,
                },
@@ -265,7 +265,7 @@ func TestHostSyncReq(t *testing.T) {
                        safcm.MsgSyncReq{},
                        []string{
                                "host1.example.org: <nil> 3 host groups: all dns host1.example.org",
                        safcm.MsgSyncReq{},
                        []string{
                                "host1.example.org: <nil> 3 host groups: all dns host1.example.org",
-                               "host1.example.org: <nil> 3 host group priorities (desc. priority): host1.example.org",
+                               "host1.example.org: <nil> 3 host group priorities (descending): host1.example.org",
                        },
                        fmt.Errorf("groups dns and all both provide file \"/etc/resolv.conf\"\nUse 'group_priority' in config.yaml to declare preference"),
                },
                        },
                        fmt.Errorf("groups dns and all both provide file \"/etc/resolv.conf\"\nUse 'group_priority' in config.yaml to declare preference"),
                },
@@ -280,7 +280,7 @@ func TestHostSyncReq(t *testing.T) {
                        safcm.MsgSyncReq{},
                        []string{
                                "host2.example.org: <nil> 3 host groups: all detected_other host2.example.org other",
                        safcm.MsgSyncReq{},
                        []string{
                                "host2.example.org: <nil> 3 host groups: all detected_other host2.example.org other",
-                               "host2.example.org: <nil> 3 host group priorities (desc. priority): host2.example.org",
+                               "host2.example.org: <nil> 3 host group priorities (descending): host2.example.org",
                        },
                        fmt.Errorf("groups other and all both provide file \"/etc/resolv.conf\"\nUse 'group_priority' in config.yaml to declare preference"),
                },
                        },
                        fmt.Errorf("groups other and all both provide file \"/etc/resolv.conf\"\nUse 'group_priority' in config.yaml to declare preference"),
                },
@@ -294,7 +294,7 @@ func TestHostSyncReq(t *testing.T) {
                        safcm.MsgSyncReq{},
                        []string{
                                "host1.example.org: <nil> 3 host groups: all dns host1.example.org",
                        safcm.MsgSyncReq{},
                        []string{
                                "host1.example.org: <nil> 3 host groups: all dns host1.example.org",
-                               "host1.example.org: <nil> 3 host group priorities (desc. priority): host1.example.org",
+                               "host1.example.org: <nil> 3 host group priorities (descending): host1.example.org",
                        },
                        fmt.Errorf("groups dns and all both provide file \"/etc\"\nUse 'group_priority' in config.yaml to declare preference"),
                },
                        },
                        fmt.Errorf("groups dns and all both provide file \"/etc\"\nUse 'group_priority' in config.yaml to declare preference"),
                },
@@ -309,7 +309,7 @@ func TestHostSyncReq(t *testing.T) {
                        safcm.MsgSyncReq{},
                        []string{
                                "host2.example.org: <nil> 3 host groups: all detected_other host2.example.org other",
                        safcm.MsgSyncReq{},
                        []string{
                                "host2.example.org: <nil> 3 host groups: all detected_other host2.example.org other",
-                               "host2.example.org: <nil> 3 host group priorities (desc. priority): host2.example.org",
+                               "host2.example.org: <nil> 3 host group priorities (descending): host2.example.org",
                        },
                        fmt.Errorf("groups other and all both provide file \"/etc\"\nUse 'group_priority' in config.yaml to declare preference"),
                },
                        },
                        fmt.Errorf("groups other and all both provide file \"/etc\"\nUse 'group_priority' in config.yaml to declare preference"),
                },
@@ -422,7 +422,7 @@ func TestHostSyncReq(t *testing.T) {
                        },
                        []string{
                                "host1.example.org: <nil> 3 host groups: all group-a group-b host1.example.org",
                        },
                        []string{
                                "host1.example.org: <nil> 3 host groups: all group-a group-b host1.example.org",
-                               "host1.example.org: <nil> 3 host group priorities (desc. priority): host1.example.org group-a group-b all",
+                               "host1.example.org: <nil> 3 host group priorities (descending): host1.example.org group-a group-b all",
                                `host1.example.org: <nil> 4 files: "/etc": group group-a overwrites triggers from group group-b`,
                                `host1.example.org: <nil> 4 files: "/etc": group host1.example.org overwrites triggers from group group-a`,
                        },
                                `host1.example.org: <nil> 4 files: "/etc": group group-a overwrites triggers from group group-b`,
                                `host1.example.org: <nil> 4 files: "/etc": group host1.example.org overwrites triggers from group group-a`,
                        },
@@ -457,7 +457,7 @@ func TestHostSyncReq(t *testing.T) {
                        },
                        []string{
                                "host1.example.org: <nil> 3 host groups: all group-a group-b host1.example.org",
                        },
                        []string{
                                "host1.example.org: <nil> 3 host groups: all group-a group-b host1.example.org",
-                               "host1.example.org: <nil> 3 host group priorities (desc. priority): host1.example.org group-a",
+                               "host1.example.org: <nil> 3 host group priorities (descending): host1.example.org group-a",
                        },
                        nil,
                },
                        },
                        nil,
                },