From: Simon Ruderich Date: Wed, 28 Apr 2021 05:57:52 +0000 (+0200) Subject: sync: remove duplicate "priority" from group priority log message X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=a583eff808817656f8ddb81ddfca3c1fd1f6c85f;p=safcm%2Fsafcm.git sync: remove duplicate "priority" from group priority log message Now that the configuration option is called "group_priority" we can remove the second "priority" and spell out "descending" (takes less space than before). --- diff --git a/cmd/safcm/main_sync_test.go b/cmd/safcm/main_sync_test.go index f58dabf..ad4acac 100644 --- a/cmd/safcm/main_sync_test.go +++ b/cmd/safcm/main_sync_test.go @@ -110,7 +110,7 @@ func TestSyncSshEndToEnd(t *testing.T) { []string{"-log", "verbose", "no-settings.example.org"}, `[info] [no-settings.example.org] remote helper upload in progress [verbose] [no-settings.example.org] host groups: all no-settings.example.org -[verbose] [no-settings.example.org] host group priorities (desc. priority): no-settings.example.org +[verbose] [no-settings.example.org] host group priorities (descending): no-settings.example.org [info] [no-settings.example.org] no changes `, nil, @@ -121,7 +121,7 @@ func TestSyncSshEndToEnd(t *testing.T) { []string{"-log", "debug2", "no-settings.example.org"}, `[info] [no-settings.example.org] remote helper upload in progress [verbose] [no-settings.example.org] host groups: all no-settings.example.org -[verbose] [no-settings.example.org] host group priorities (desc. priority): no-settings.example.org +[verbose] [no-settings.example.org] host group priorities (descending): no-settings.example.org [info] [no-settings.example.org] no changes `, nil, diff --git a/cmd/safcm/sync_sync.go b/cmd/safcm/sync_sync.go index f07d07f..6977edd 100644 --- a/cmd/safcm/sync_sync.go +++ b/cmd/safcm/sync_sync.go @@ -85,7 +85,7 @@ func (s *Sync) hostSyncReq(detectedGroups []string) ( 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, " ")) } diff --git a/cmd/safcm/sync_sync_test.go b/cmd/safcm/sync_sync_test.go index b8a53a4..f0e7524 100644 --- a/cmd/safcm/sync_sync_test.go +++ b/cmd/safcm/sync_sync_test.go @@ -149,7 +149,7 @@ func TestHostSyncReq(t *testing.T) { }, []string{ "host1.example.org: 3 host groups: all group group3 host1.example.org remove", - "host1.example.org: 3 host group priorities (desc. priority): host1.example.org", + "host1.example.org: 3 host group priorities (descending): host1.example.org", }, nil, }, @@ -265,7 +265,7 @@ func TestHostSyncReq(t *testing.T) { safcm.MsgSyncReq{}, []string{ "host1.example.org: 3 host groups: all dns host1.example.org", - "host1.example.org: 3 host group priorities (desc. priority): host1.example.org", + "host1.example.org: 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"), }, @@ -280,7 +280,7 @@ func TestHostSyncReq(t *testing.T) { safcm.MsgSyncReq{}, []string{ "host2.example.org: 3 host groups: all detected_other host2.example.org other", - "host2.example.org: 3 host group priorities (desc. priority): host2.example.org", + "host2.example.org: 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"), }, @@ -294,7 +294,7 @@ func TestHostSyncReq(t *testing.T) { safcm.MsgSyncReq{}, []string{ "host1.example.org: 3 host groups: all dns host1.example.org", - "host1.example.org: 3 host group priorities (desc. priority): host1.example.org", + "host1.example.org: 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"), }, @@ -309,7 +309,7 @@ func TestHostSyncReq(t *testing.T) { safcm.MsgSyncReq{}, []string{ "host2.example.org: 3 host groups: all detected_other host2.example.org other", - "host2.example.org: 3 host group priorities (desc. priority): host2.example.org", + "host2.example.org: 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"), }, @@ -422,7 +422,7 @@ func TestHostSyncReq(t *testing.T) { }, []string{ "host1.example.org: 3 host groups: all group-a group-b host1.example.org", - "host1.example.org: 3 host group priorities (desc. priority): host1.example.org group-a group-b all", + "host1.example.org: 3 host group priorities (descending): host1.example.org group-a group-b all", `host1.example.org: 4 files: "/etc": group group-a overwrites triggers from group group-b`, `host1.example.org: 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: 3 host groups: all group-a group-b host1.example.org", - "host1.example.org: 3 host group priorities (desc. priority): host1.example.org group-a", + "host1.example.org: 3 host group priorities (descending): host1.example.org group-a", }, nil, },