From 35c082709bb4fae99e61debf65e146507f265fcc Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 12 May 2021 08:22:17 +0200 Subject: [PATCH] sync: shorten log messages by removing "info/sync remote:" prefix The prefix provides little value as it already obvious what's happening on the remote side and in which phase (info/sync). Keeping the log messages shorter helps the user to focus on the important parts of the message. --- cmd/safcm-remote/info/info.go | 6 +- cmd/safcm-remote/log/logger.go | 6 +- cmd/safcm-remote/sync/commands_test.go | 38 +- cmd/safcm-remote/sync/files_test.go | 342 +++++++++--------- cmd/safcm-remote/sync/packages_debian_test.go | 36 +- .../sync/services_systemd_test.go | 56 +-- cmd/safcm-remote/sync/sync.go | 14 +- cmd/safcm-remote/sync/sync_test.go | 2 +- cmd/safcm/main_sync_test.go | 30 +- 9 files changed, 262 insertions(+), 268 deletions(-) diff --git a/cmd/safcm-remote/info/info.go b/cmd/safcm-remote/info/info.go index 4de44f3..15bf048 100644 --- a/cmd/safcm-remote/info/info.go +++ b/cmd/safcm-remote/info/info.go @@ -34,20 +34,18 @@ type Info struct { logger *log.Logger } -const logPrefix = "info remote:" - func Handle(req safcm.MsgInfoReq, runner run.Runner, fun log.LogFunc) safcm.MsgInfoResp { i := Info{ req: req, - logger: log.NewLogger(logPrefix, fun), + logger: log.NewLogger(fun), } i.cmd = run.NewCmd(runner, i.logger) err := i.handle() if err != nil { - i.resp.Error = fmt.Sprintf("%s %v", logPrefix, err) + i.resp.Error = fmt.Sprintf("%v", err) } return i.resp } diff --git a/cmd/safcm-remote/log/logger.go b/cmd/safcm-remote/log/logger.go index 8bf0a43..b9fbcf3 100644 --- a/cmd/safcm-remote/log/logger.go +++ b/cmd/safcm-remote/log/logger.go @@ -28,13 +28,11 @@ type LogFunc func(level safcm.LogLevel, msg string) type Logger struct { fun LogFunc - prefix string } -func NewLogger(prefix string, fun LogFunc) *Logger { +func NewLogger(fun LogFunc) *Logger { return &Logger{ fun: fun, - prefix: prefix, } } @@ -50,5 +48,5 @@ func (l *Logger) Debug2f(format string, a ...interface{}) { func (l *Logger) log(level safcm.LogLevel, format string, a ...interface{}) { - l.fun(level, l.prefix+" "+fmt.Sprintf(format, a...)) + l.fun(level, fmt.Sprintf(format, a...)) } diff --git a/cmd/safcm-remote/sync/commands_test.go b/cmd/safcm-remote/sync/commands_test.go index f6293b4..0bd0949 100644 --- a/cmd/safcm-remote/sync/commands_test.go +++ b/cmd/safcm-remote/sync/commands_test.go @@ -85,8 +85,8 @@ func TestSyncCommands(t *testing.T) { Env: env, }}, []string{ - `3: sync remote: commands: running "/bin/sh" "-c" "echo; env | grep SAFCM_" (group)`, - "5: sync remote: commands: command output:\nfake stdout/stderr", + `3: commands: running "/bin/sh" "-c" "echo; env | grep SAFCM_" (group)`, + "5: commands: command output:\nfake stdout/stderr", }, safcm.MsgSyncResp{ CommandChanges: []safcm.CommandChange{ @@ -160,8 +160,8 @@ func TestSyncCommands(t *testing.T) { Env: env, }}, []string{ - `3: sync remote: commands: running "/bin/sh" "-c" "echo hi; false" (group)`, - "5: sync remote: commands: command output:\nfake stdout/stderr", + `3: commands: running "/bin/sh" "-c" "echo hi; false" (group)`, + "5: commands: command output:\nfake stdout/stderr", }, safcm.MsgSyncResp{ CommandChanges: []safcm.CommandChange{ @@ -271,11 +271,11 @@ func TestSyncCommands(t *testing.T) { Env: env, }}, []string{ - `3: sync remote: commands: running "/bin/sh" "-c" "echo first" (group1)`, - "5: sync remote: commands: command output:\nfake stdout/stderr first", - `3: sync remote: commands: running "/bin/sh" "-c" "echo second" (group2)`, - "5: sync remote: commands: command output:\nfake stdout/stderr second", - `3: sync remote: commands: running "/bin/sh" "-c" "false" (group3)`, + `3: commands: running "/bin/sh" "-c" "echo first" (group1)`, + "5: commands: command output:\nfake stdout/stderr first", + `3: commands: running "/bin/sh" "-c" "echo second" (group2)`, + "5: commands: command output:\nfake stdout/stderr second", + `3: commands: running "/bin/sh" "-c" "false" (group3)`, }, safcm.MsgSyncResp{ CommandChanges: []safcm.CommandChange{ @@ -388,12 +388,12 @@ func TestSyncCommands(t *testing.T) { Env: env, }}, []string{ - `3: sync remote: commands: running "/bin/sh" "-c" "echo trigger ." (".")`, - "5: sync remote: commands: command output:\nfake stdout/stderr .", - `3: sync remote: commands: running "/bin/sh" "-c" "echo trigger dir" ("dir")`, - "5: sync remote: commands: command output:\nfake stdout/stderr dir", - `3: sync remote: commands: running "/bin/sh" "-c" "echo; env | grep SAFCM_" (group)`, - "5: sync remote: commands: command output:\nfake stdout/stderr", + `3: commands: running "/bin/sh" "-c" "echo trigger ." (".")`, + "5: commands: command output:\nfake stdout/stderr .", + `3: commands: running "/bin/sh" "-c" "echo trigger dir" ("dir")`, + "5: commands: command output:\nfake stdout/stderr dir", + `3: commands: running "/bin/sh" "-c" "echo; env | grep SAFCM_" (group)`, + "5: commands: command output:\nfake stdout/stderr", }, safcm.MsgSyncResp{ CommandChanges: []safcm.CommandChange{ @@ -497,10 +497,10 @@ func TestSyncCommands(t *testing.T) { Env: env, }}, []string{ - `3: sync remote: commands: running "/bin/sh" "-c" "echo trigger ." (".")`, - "5: sync remote: commands: command output:\nfake stdout/stderr .", - `3: sync remote: commands: running "/bin/sh" "-c" "false" ("dir")`, - "5: sync remote: commands: command output:\nfake stdout/stderr dir", + `3: commands: running "/bin/sh" "-c" "echo trigger ." (".")`, + "5: commands: command output:\nfake stdout/stderr .", + `3: commands: running "/bin/sh" "-c" "false" ("dir")`, + "5: commands: command output:\nfake stdout/stderr dir", }, safcm.MsgSyncResp{ CommandChanges: []safcm.CommandChange{ diff --git a/cmd/safcm-remote/sync/files_test.go b/cmd/safcm-remote/sync/files_test.go index 57d27c7..88a5b51 100644 --- a/cmd/safcm-remote/sync/files_test.go +++ b/cmd/safcm-remote/sync/files_test.go @@ -145,16 +145,16 @@ func TestSyncFiles(t *testing.T) { }, }, []string{ - `4: sync remote: files: "." (group): unchanged`, - `4: sync remote: files: "dir" (group): will create`, - `3: sync remote: files: "dir" (group): creating`, - `4: sync remote: files: "dir" (group): creating directory`, - `4: sync remote: files: "dir" (group): chmodding drwxr-xr-x`, - fmt.Sprintf(`4: sync remote: files: "dir" (group): chowning %d/%d`, uid, gid), - `4: sync remote: files: "dir/file" (group): will create`, - `3: sync remote: files: "dir/file" (group): creating`, - `4: sync remote: files: "dir/file" (group): creating temporary file "dir/.file*"`, - `4: sync remote: files: "dir/file" (group): renaming "dir/.fileRND"`, + `4: files: "." (group): unchanged`, + `4: files: "dir" (group): will create`, + `3: files: "dir" (group): creating`, + `4: files: "dir" (group): creating directory`, + `4: files: "dir" (group): chmodding drwxr-xr-x`, + fmt.Sprintf(`4: files: "dir" (group): chowning %d/%d`, uid, gid), + `4: files: "dir/file" (group): will create`, + `3: files: "dir/file" (group): creating`, + `4: files: "dir/file" (group): creating temporary file "dir/.file*"`, + `4: files: "dir/file" (group): renaming "dir/.fileRND"`, }, nil, }, @@ -207,9 +207,9 @@ func TestSyncFiles(t *testing.T) { }, safcm.MsgSyncResp{}, []string{ - `4: sync remote: files: "." (group): unchanged`, - `4: sync remote: files: "dir" (group): unchanged`, - `4: sync remote: files: "dir/file" (group): unchanged`, + `4: files: "." (group): unchanged`, + `4: files: "dir" (group): unchanged`, + `4: files: "dir/file" (group): unchanged`, }, nil, }, @@ -305,9 +305,9 @@ func TestSyncFiles(t *testing.T) { }, safcm.MsgSyncResp{}, []string{ - `4: sync remote: files: "/" (group): unchanged`, - `4: sync remote: files: "/etc" (group): unchanged`, - `4: sync remote: files: "/tmp" (group): unchanged`, + `4: files: "/" (group): unchanged`, + `4: files: "/etc" (group): unchanged`, + `4: files: "/tmp" (group): unchanged`, }, nil, }, @@ -369,9 +369,9 @@ func TestSyncFiles(t *testing.T) { }, safcm.MsgSyncResp{}, []string{ - `4: sync remote: files: "." (group): unchanged`, - `4: sync remote: files: "dir" (group): unchanged`, - `4: sync remote: files: "dir/file" (group): unchanged`, + `4: files: "." (group): unchanged`, + `4: files: "dir" (group): unchanged`, + `4: files: "dir/file" (group): unchanged`, }, nil, }, @@ -456,12 +456,12 @@ func TestSyncFiles(t *testing.T) { }, }, []string{ - `4: sync remote: files: "." (group): permission differs drwxr-x--- -> drwx------`, - `3: sync remote: files: "." (group): updating`, - `4: sync remote: files: "." (group): chmodding drwx------`, - `3: sync remote: files: ".": queuing trigger on "."`, - `4: sync remote: files: "dir" (group): unchanged`, - `4: sync remote: files: "dir/file" (group): unchanged`, + `4: files: "." (group): permission differs drwxr-x--- -> drwx------`, + `3: files: "." (group): updating`, + `4: files: "." (group): chmodding drwx------`, + `3: files: ".": queuing trigger on "."`, + `4: files: "dir" (group): unchanged`, + `4: files: "dir/file" (group): unchanged`, }, nil, }, @@ -546,13 +546,13 @@ func TestSyncFiles(t *testing.T) { }, }, []string{ - `4: sync remote: files: "." (group): unchanged`, - `4: sync remote: files: "dir" (group): permission differs drwxr-x--- -> drwxr-xr-x`, - `3: sync remote: files: "dir" (group): updating`, - `4: sync remote: files: "dir" (group): chmodding drwxr-xr-x`, - `3: sync remote: files: "dir": queuing trigger on "."`, - `3: sync remote: files: "dir": queuing trigger on "dir"`, - `4: sync remote: files: "dir/file" (group): unchanged`, + `4: files: "." (group): unchanged`, + `4: files: "dir" (group): permission differs drwxr-x--- -> drwxr-xr-x`, + `3: files: "dir" (group): updating`, + `4: files: "dir" (group): chmodding drwxr-xr-x`, + `3: files: "dir": queuing trigger on "."`, + `3: files: "dir": queuing trigger on "dir"`, + `4: files: "dir/file" (group): unchanged`, }, nil, }, @@ -631,15 +631,15 @@ func TestSyncFiles(t *testing.T) { }, }, []string{ - `4: sync remote: files: "." (group): unchanged`, - `4: sync remote: files: "dir" (group): unchanged`, - `4: sync remote: files: "dir/file" (group): will create`, - `3: sync remote: files: "dir/file" (group): creating`, - `4: sync remote: files: "dir/file" (group): creating temporary file "dir/.file*"`, - `4: sync remote: files: "dir/file" (group): renaming "dir/.fileRND"`, - `3: sync remote: files: "dir/file": queuing trigger on "."`, - `3: sync remote: files: "dir/file": queuing trigger on "dir"`, - `3: sync remote: files: "dir/file": queuing trigger on "dir/file"`, + `4: files: "." (group): unchanged`, + `4: files: "dir" (group): unchanged`, + `4: files: "dir/file" (group): will create`, + `3: files: "dir/file" (group): creating`, + `4: files: "dir/file" (group): creating temporary file "dir/.file*"`, + `4: files: "dir/file" (group): renaming "dir/.fileRND"`, + `3: files: "dir/file": queuing trigger on "."`, + `3: files: "dir/file": queuing trigger on "dir"`, + `3: files: "dir/file": queuing trigger on "dir/file"`, }, nil, }, @@ -727,21 +727,21 @@ func TestSyncFiles(t *testing.T) { }, }, []string{ - `4: sync remote: files: "." (group): unchanged`, - `4: sync remote: files: "dir" (group): will create`, - `3: sync remote: files: "dir" (group): creating`, - `4: sync remote: files: "dir" (group): creating directory`, - `4: sync remote: files: "dir" (group): chmodding drwxr-xr-x`, - fmt.Sprintf(`4: sync remote: files: "dir" (group): chowning %d/%d`, uid, gid), - `3: sync remote: files: "dir": queuing trigger on "."`, - `3: sync remote: files: "dir": queuing trigger on "dir"`, - `4: sync remote: files: "dir/file" (group): will create`, - `3: sync remote: files: "dir/file" (group): creating`, - `4: sync remote: files: "dir/file" (group): creating temporary file "dir/.file*"`, - `4: sync remote: files: "dir/file" (group): renaming "dir/.fileRND"`, - `4: sync remote: files: "dir/file": skipping trigger on ".", already active`, - `4: sync remote: files: "dir/file": skipping trigger on "dir", already active`, - `3: sync remote: files: "dir/file": queuing trigger on "dir/file"`, + `4: files: "." (group): unchanged`, + `4: files: "dir" (group): will create`, + `3: files: "dir" (group): creating`, + `4: files: "dir" (group): creating directory`, + `4: files: "dir" (group): chmodding drwxr-xr-x`, + fmt.Sprintf(`4: files: "dir" (group): chowning %d/%d`, uid, gid), + `3: files: "dir": queuing trigger on "."`, + `3: files: "dir": queuing trigger on "dir"`, + `4: files: "dir/file" (group): will create`, + `3: files: "dir/file" (group): creating`, + `4: files: "dir/file" (group): creating temporary file "dir/.file*"`, + `4: files: "dir/file" (group): renaming "dir/.fileRND"`, + `4: files: "dir/file": skipping trigger on ".", already active`, + `4: files: "dir/file": skipping trigger on "dir", already active`, + `3: files: "dir/file": queuing trigger on "dir/file"`, }, nil, }, @@ -809,15 +809,15 @@ func TestSyncFiles(t *testing.T) { }, }, []string{ - `4: sync remote: files: "/" (group): unchanged`, - `4: sync remote: files: "/tmp" (group): unchanged`, - `4: sync remote: files: "/tmp/safcm-sync-files-test-file" (group): will create`, - `3: sync remote: files: "/tmp/safcm-sync-files-test-file" (group): creating`, - `4: sync remote: files: "/tmp/safcm-sync-files-test-file" (group): creating temporary file "/tmp/.safcm-sync-files-test-file*"`, - `4: sync remote: files: "/tmp/safcm-sync-files-test-file" (group): renaming "/tmp/.safcm-sync-files-test-fileRND"`, - `3: sync remote: files: "/tmp/safcm-sync-files-test-file": queuing trigger on "/"`, - `3: sync remote: files: "/tmp/safcm-sync-files-test-file": queuing trigger on "/tmp"`, - `3: sync remote: files: "/tmp/safcm-sync-files-test-file": queuing trigger on "/tmp/safcm-sync-files-test-file"`, + `4: files: "/" (group): unchanged`, + `4: files: "/tmp" (group): unchanged`, + `4: files: "/tmp/safcm-sync-files-test-file" (group): will create`, + `3: files: "/tmp/safcm-sync-files-test-file" (group): creating`, + `4: files: "/tmp/safcm-sync-files-test-file" (group): creating temporary file "/tmp/.safcm-sync-files-test-file*"`, + `4: files: "/tmp/safcm-sync-files-test-file" (group): renaming "/tmp/.safcm-sync-files-test-fileRND"`, + `3: files: "/tmp/safcm-sync-files-test-file": queuing trigger on "/"`, + `3: files: "/tmp/safcm-sync-files-test-file": queuing trigger on "/tmp"`, + `3: files: "/tmp/safcm-sync-files-test-file": queuing trigger on "/tmp/safcm-sync-files-test-file"`, }, nil, }, @@ -960,10 +960,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "file" (group): will create`, - `3: sync remote: files: "file" (group): creating`, - `4: sync remote: files: "file" (group): creating temporary file ".file*"`, - `4: sync remote: files: "file" (group): renaming "./.fileRND"`, + `4: files: "file" (group): will create`, + `3: files: "file" (group): creating`, + `4: files: "file" (group): creating temporary file ".file*"`, + `4: files: "file" (group): renaming "./.fileRND"`, }, nil, }, @@ -999,9 +999,9 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "file" (group): will create`, - `3: sync remote: files: "file" (group): creating`, - `4: sync remote: files: "file" (group): dry-run, skipping changes`, + `4: files: "file" (group): will create`, + `3: files: "file" (group): creating`, + `4: files: "file" (group): dry-run, skipping changes`, }, nil, }, @@ -1031,7 +1031,7 @@ func TestSyncFile(t *testing.T) { }, safcm.MsgSyncResp{}, []string{ - `4: sync remote: files: "file" (group): unchanged`, + `4: files: "file" (group): unchanged`, }, nil, }, @@ -1063,7 +1063,7 @@ func TestSyncFile(t *testing.T) { }, safcm.MsgSyncResp{}, []string{ - `4: sync remote: files: "file" (group): unchanged`, + `4: files: "file" (group): unchanged`, }, nil, }, @@ -1113,10 +1113,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "file" (group): permission differs -rwxr-xr-x -> urwxr-xr-x`, - `3: sync remote: files: "file" (group): updating`, - `4: sync remote: files: "file" (group): creating temporary file ".file*"`, - `4: sync remote: files: "file" (group): renaming "./.fileRND"`, + `4: files: "file" (group): permission differs -rwxr-xr-x -> urwxr-xr-x`, + `3: files: "file" (group): updating`, + `4: files: "file" (group): creating temporary file ".file*"`, + `4: files: "file" (group): renaming "./.fileRND"`, }, nil, }, @@ -1171,10 +1171,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "file" (group): content differs`, - `3: sync remote: files: "file" (group): updating`, - `4: sync remote: files: "file" (group): creating temporary file ".file*"`, - `4: sync remote: files: "file" (group): renaming "./.fileRND"`, + `4: files: "file" (group): content differs`, + `3: files: "file" (group): updating`, + `4: files: "file" (group): creating temporary file ".file*"`, + `4: files: "file" (group): renaming "./.fileRND"`, }, nil, }, @@ -1218,10 +1218,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "link" (group): will create`, - `3: sync remote: files: "link" (group): creating`, - `4: sync remote: files: "link" (group): creating temporary symlink ".linkRND"`, - `4: sync remote: files: "link" (group): renaming ".linkRND"`, + `4: files: "link" (group): will create`, + `3: files: "link" (group): creating`, + `4: files: "link" (group): creating temporary symlink ".linkRND"`, + `4: files: "link" (group): renaming ".linkRND"`, }, nil, }, @@ -1269,11 +1269,11 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "link" (group): will create`, - `3: sync remote: files: "link" (group): creating`, - `4: sync remote: files: "link" (group): creating temporary symlink ".linkRND"`, - `4: sync remote: files: "link" (group): creating temporary symlink ".linkRND"`, - `4: sync remote: files: "link" (group): renaming ".linkRND"`, + `4: files: "link" (group): will create`, + `3: files: "link" (group): creating`, + `4: files: "link" (group): creating temporary symlink ".linkRND"`, + `4: files: "link" (group): creating temporary symlink ".linkRND"`, + `4: files: "link" (group): renaming ".linkRND"`, }, nil, }, @@ -1309,9 +1309,9 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "link" (group): will create`, - `3: sync remote: files: "link" (group): creating`, - `4: sync remote: files: "link" (group): dry-run, skipping changes`, + `4: files: "link" (group): will create`, + `3: files: "link" (group): creating`, + `4: files: "link" (group): dry-run, skipping changes`, }, nil, }, @@ -1341,7 +1341,7 @@ func TestSyncFile(t *testing.T) { }, safcm.MsgSyncResp{}, []string{ - `4: sync remote: files: "link" (group): unchanged`, + `4: files: "link" (group): unchanged`, }, nil, }, @@ -1395,10 +1395,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "link" (group): content differs`, - `3: sync remote: files: "link" (group): updating`, - `4: sync remote: files: "link" (group): creating temporary symlink ".linkRND"`, - `4: sync remote: files: "link" (group): renaming ".linkRND"`, + `4: files: "link" (group): content differs`, + `3: files: "link" (group): updating`, + `4: files: "link" (group): creating temporary symlink ".linkRND"`, + `4: files: "link" (group): renaming ".linkRND"`, }, nil, }, @@ -1440,11 +1440,11 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "dir" (group): will create`, - `3: sync remote: files: "dir" (group): creating`, - `4: sync remote: files: "dir" (group): creating directory`, - `4: sync remote: files: "dir" (group): chmodding drwx---r-x`, - fmt.Sprintf(`4: sync remote: files: "dir" (group): chowning %d/%d`, uid, gid), + `4: files: "dir" (group): will create`, + `3: files: "dir" (group): creating`, + `4: files: "dir" (group): creating directory`, + `4: files: "dir" (group): chmodding drwx---r-x`, + fmt.Sprintf(`4: files: "dir" (group): chowning %d/%d`, uid, gid), }, nil, }, @@ -1479,9 +1479,9 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "dir" (group): will create`, - `3: sync remote: files: "dir" (group): creating`, - `4: sync remote: files: "dir" (group): dry-run, skipping changes`, + `4: files: "dir" (group): will create`, + `3: files: "dir" (group): creating`, + `4: files: "dir" (group): dry-run, skipping changes`, }, nil, }, @@ -1509,7 +1509,7 @@ func TestSyncFile(t *testing.T) { }, safcm.MsgSyncResp{}, []string{ - `4: sync remote: files: "dir" (group): unchanged`, + `4: files: "dir" (group): unchanged`, }, nil, }, @@ -1557,9 +1557,9 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "dir" (group): permission differs dtr-x------ -> dgrwxr-xr-x`, - `3: sync remote: files: "dir" (group): updating`, - `4: sync remote: files: "dir" (group): chmodding dgrwxr-xr-x`, + `4: files: "dir" (group): permission differs dtr-x------ -> dgrwxr-xr-x`, + `3: files: "dir" (group): updating`, + `4: files: "dir" (group): chmodding dgrwxr-xr-x`, }, nil, }, @@ -1613,12 +1613,12 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs ---------- -> d---------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): removing (due to type change)`, - `4: sync remote: files: "path" (group): creating directory`, - `4: sync remote: files: "path" (group): chmodding drwxr-x--x`, - fmt.Sprintf(`4: sync remote: files: "path" (group): chowning %d/%d`, uid, gid), + `4: files: "path" (group): type differs ---------- -> d---------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): removing (due to type change)`, + `4: files: "path" (group): creating directory`, + `4: files: "path" (group): chmodding drwxr-x--x`, + fmt.Sprintf(`4: files: "path" (group): chowning %d/%d`, uid, gid), }, nil, }, @@ -1673,10 +1673,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs ---------- -> L---------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): creating temporary symlink ".pathRND"`, - `4: sync remote: files: "path" (group): renaming ".pathRND"`, + `4: files: "path" (group): type differs ---------- -> L---------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): creating temporary symlink ".pathRND"`, + `4: files: "path" (group): renaming ".pathRND"`, }, nil, }, @@ -1731,10 +1731,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs L--------- -> ----------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): creating temporary file ".path*"`, - `4: sync remote: files: "path" (group): renaming "./.pathRND"`, + `4: files: "path" (group): type differs L--------- -> ----------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): creating temporary file ".path*"`, + `4: files: "path" (group): renaming "./.pathRND"`, }, nil, }, @@ -1786,12 +1786,12 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs L--------- -> d---------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): removing (due to type change)`, - `4: sync remote: files: "path" (group): creating directory`, - `4: sync remote: files: "path" (group): chmodding drwxr-x--x`, - fmt.Sprintf(`4: sync remote: files: "path" (group): chowning %d/%d`, uid, gid), + `4: files: "path" (group): type differs L--------- -> d---------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): removing (due to type change)`, + `4: files: "path" (group): creating directory`, + `4: files: "path" (group): chmodding drwxr-x--x`, + fmt.Sprintf(`4: files: "path" (group): chowning %d/%d`, uid, gid), }, nil, }, @@ -1841,11 +1841,11 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs d--------- -> ----------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): removing (due to type change)`, - `4: sync remote: files: "path" (group): creating temporary file ".path*"`, - `4: sync remote: files: "path" (group): renaming "./.pathRND"`, + `4: files: "path" (group): type differs d--------- -> ----------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): removing (due to type change)`, + `4: files: "path" (group): creating temporary file ".path*"`, + `4: files: "path" (group): renaming "./.pathRND"`, }, nil, }, @@ -1895,11 +1895,11 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs d--------- -> L---------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): removing (due to type change)`, - `4: sync remote: files: "path" (group): creating temporary symlink ".pathRND"`, - `4: sync remote: files: "path" (group): renaming ".pathRND"`, + `4: files: "path" (group): type differs d--------- -> L---------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): removing (due to type change)`, + `4: files: "path" (group): creating temporary symlink ".pathRND"`, + `4: files: "path" (group): renaming ".pathRND"`, }, nil, }, @@ -1949,10 +1949,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs p--------- -> ----------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): creating temporary file ".path*"`, - `4: sync remote: files: "path" (group): renaming "./.pathRND"`, + `4: files: "path" (group): type differs p--------- -> ----------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): creating temporary file ".path*"`, + `4: files: "path" (group): renaming "./.pathRND"`, }, nil, }, @@ -2002,10 +2002,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs p--------- -> L---------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): creating temporary symlink ".pathRND"`, - `4: sync remote: files: "path" (group): renaming ".pathRND"`, + `4: files: "path" (group): type differs p--------- -> L---------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): creating temporary symlink ".pathRND"`, + `4: files: "path" (group): renaming ".pathRND"`, }, nil, }, @@ -2053,12 +2053,12 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs p--------- -> d---------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): removing (due to type change)`, - `4: sync remote: files: "path" (group): creating directory`, - `4: sync remote: files: "path" (group): chmodding drwxr-x--x`, - fmt.Sprintf(`4: sync remote: files: "path" (group): chowning %d/%d`, uid, gid), + `4: files: "path" (group): type differs p--------- -> d---------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): removing (due to type change)`, + `4: files: "path" (group): creating directory`, + `4: files: "path" (group): chmodding drwxr-x--x`, + fmt.Sprintf(`4: files: "path" (group): chowning %d/%d`, uid, gid), }, nil, }, @@ -2108,10 +2108,10 @@ func TestSyncFile(t *testing.T) { }, }, []string{ - `4: sync remote: files: "path" (group): type differs ---------- -> L---------`, - `3: sync remote: files: "path" (group): updating`, - `4: sync remote: files: "path" (group): creating temporary symlink ".pathRND"`, - `4: sync remote: files: "path" (group): renaming ".pathRND"`, + `4: files: "path" (group): type differs ---------- -> L---------`, + `3: files: "path" (group): updating`, + `4: files: "path" (group): creating temporary symlink ".pathRND"`, + `4: files: "path" (group): renaming ".pathRND"`, }, nil, }, @@ -2189,9 +2189,9 @@ file }, }, []string{ - `4: sync remote: files: "file" (group): content differs`, - `3: sync remote: files: "file" (group): updating`, - `4: sync remote: files: "file" (group): dry-run, skipping changes`, + `4: files: "file" (group): content differs`, + `3: files: "file" (group): updating`, + `4: files: "file" (group): dry-run, skipping changes`, }, nil, }, @@ -2244,9 +2244,9 @@ file }, }, []string{ - `4: sync remote: files: "file" (group): content differs`, - `3: sync remote: files: "file" (group): updating`, - `4: sync remote: files: "file" (group): dry-run, skipping changes`, + `4: files: "file" (group): content differs`, + `3: files: "file" (group): updating`, + `4: files: "file" (group): dry-run, skipping changes`, }, nil, }, @@ -2303,9 +2303,9 @@ file }, }, []string{ - `4: sync remote: files: "file" (group): content differs`, - `3: sync remote: files: "file" (group): updating`, - `4: sync remote: files: "file" (group): dry-run, skipping changes`, + `4: files: "file" (group): content differs`, + `3: files: "file" (group): updating`, + `4: files: "file" (group): dry-run, skipping changes`, }, nil, }, @@ -2362,9 +2362,9 @@ file }, }, []string{ - `4: sync remote: files: "file" (group): content differs`, - `3: sync remote: files: "file" (group): updating`, - `4: sync remote: files: "file" (group): dry-run, skipping changes`, + `4: files: "file" (group): content differs`, + `3: files: "file" (group): updating`, + `4: files: "file" (group): dry-run, skipping changes`, }, nil, }, diff --git a/cmd/safcm-remote/sync/packages_debian_test.go b/cmd/safcm-remote/sync/packages_debian_test.go index a51a6a9..97b8c61 100644 --- a/cmd/safcm-remote/sync/packages_debian_test.go +++ b/cmd/safcm-remote/sync/packages_debian_test.go @@ -73,9 +73,9 @@ install ok installed package-two Stderr: &bytes.Buffer{}, }}, []string{ - "4: sync remote: packages: checking package-one package-two (debian detected)", - `4: sync remote: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`, - `5: sync remote: packages: command stdout: + "4: packages: checking package-one package-two (debian detected)", + `4: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`, + `5: packages: command stdout: install ok installed golang install ok installed golang-1.16 install ok installed golang-1.16-doc @@ -137,9 +137,9 @@ install ok installed package-two ), }}, []string{ - "4: sync remote: packages: checking package-one package-two package-three (debian detected)", - `4: sync remote: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`, - `5: sync remote: packages: command stdout: + "4: packages: checking package-one package-two package-three (debian detected)", + `4: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`, + `5: packages: command stdout: install ok installed golang install ok installed golang-1.16 install ok installed golang-1.16-doc @@ -147,9 +147,9 @@ install ok installed golang-1.16-go install ok installed golang-1.16-src install ok installed package-two `, - "3: sync remote: packages: installing package-one package-three", - `4: sync remote: packages: running "/usr/bin/apt-get" "install" "--assume-yes" "--no-upgrade" "--no-install-recommends" "-o" "Dpkg::Options::=--force-confdef" "-o" "Dpkg::Options::=--force-confold" "package-one" "package-three"`, - "5: sync remote: packages: command output:\nfake stdout/stderr", + "3: packages: installing package-one package-three", + `4: packages: running "/usr/bin/apt-get" "install" "--assume-yes" "--no-upgrade" "--no-install-recommends" "-o" "Dpkg::Options::=--force-confdef" "-o" "Dpkg::Options::=--force-confold" "package-one" "package-three"`, + "5: packages: command output:\nfake stdout/stderr", }, safcm.MsgSyncResp{ PackageChanges: []safcm.PackageChange{ @@ -213,18 +213,18 @@ install ok installed golang-1.16-src ), }}, []string{ - "4: sync remote: packages: checking package-one package-two (debian detected)", - `4: sync remote: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`, - `5: sync remote: packages: command stdout: + "4: packages: checking package-one package-two (debian detected)", + `4: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`, + `5: packages: command stdout: install ok installed golang install ok installed golang-1.16 install ok installed golang-1.16-doc install ok installed golang-1.16-go install ok installed golang-1.16-src `, - "3: sync remote: packages: installing package-one package-two", - `4: sync remote: packages: running "/usr/bin/apt-get" "install" "--assume-yes" "--no-upgrade" "--no-install-recommends" "-o" "Dpkg::Options::=--force-confdef" "-o" "Dpkg::Options::=--force-confold" "package-one" "package-two"`, - "5: sync remote: packages: command output:\nfake stdout/stderr", + "3: packages: installing package-one package-two", + `4: packages: running "/usr/bin/apt-get" "install" "--assume-yes" "--no-upgrade" "--no-install-recommends" "-o" "Dpkg::Options::=--force-confdef" "-o" "Dpkg::Options::=--force-confold" "package-one" "package-two"`, + "5: packages: command output:\nfake stdout/stderr", }, safcm.MsgSyncResp{ PackageChanges: []safcm.PackageChange{ @@ -269,9 +269,9 @@ install ok installed golang-1.16-src Stderr: &bytes.Buffer{}, }}, []string{ - "4: sync remote: packages: checking package-one package-two (debian detected)", - `4: sync remote: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`, - `5: sync remote: packages: command stdout: + "4: packages: checking package-one package-two (debian detected)", + `4: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`, + `5: packages: command stdout: install ok installed golang install ok installed golang-1.16 install ok installed golang-1.16-doc diff --git a/cmd/safcm-remote/sync/services_systemd_test.go b/cmd/safcm-remote/sync/services_systemd_test.go index cf0f4ab..5aa36cd 100644 --- a/cmd/safcm-remote/sync/services_systemd_test.go +++ b/cmd/safcm-remote/sync/services_systemd_test.go @@ -75,9 +75,9 @@ LoadError= Stderr: &bytes.Buffer{}, }}, []string{ - "4: sync remote: services: checking service-one service-two (systemd detected)", - `4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two"`, - `5: sync remote: services: command stdout: + "4: services: checking service-one service-two (systemd detected)", + `4: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two"`, + `5: services: command stdout: ActiveState=active UnitFileState=enabled LoadError= @@ -125,9 +125,9 @@ LoadError= "" Stderr: &bytes.Buffer{}, }}, []string{ - "4: sync remote: services: checking service-one service-two (systemd detected)", - `4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two"`, - `5: sync remote: services: command stdout: + "4: services: checking service-one service-two (systemd detected)", + `4: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two"`, + `5: services: command stdout: ActiveState=active UnitFileState=enabled LoadError= "" @@ -175,9 +175,9 @@ LoadError= Stderr: &bytes.Buffer{}, }}, []string{ - "4: sync remote: services: checking service-does-not-exist service-two (systemd detected)", - `4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-does-not-exist" "service-two"`, - `5: sync remote: services: command stdout: + "4: services: checking service-does-not-exist service-two (systemd detected)", + `4: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-does-not-exist" "service-two"`, + `5: services: command stdout: ActiveState=inactive UnitFileState= LoadError=org.freedesktop.systemd1.NoSuchUnit "Unit service-does-not-exist.service not found." @@ -269,9 +269,9 @@ LoadError= Stderr: &bytes.Buffer{}, }}, []string{ - "4: sync remote: services: checking service-one service-two service-three (systemd detected)", - `4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`, - `5: sync remote: services: command stdout: + "4: services: checking service-one service-two service-three (systemd detected)", + `4: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`, + `5: services: command stdout: ActiveState=inactive UnitFileState=enabled LoadError= @@ -284,12 +284,12 @@ ActiveState=failed UnitFileState=disabled LoadError= `, - `4: sync remote: services: running "/bin/systemctl" "daemon-reload"`, - "3: sync remote: services: starting service-one service-three", - `4: sync remote: services: running "/bin/systemctl" "start" "--" "service-one" "service-three"`, - "3: sync remote: services: enabling service-two service-three", - `4: sync remote: services: running "/bin/systemctl" "enable" "--" "service-two" "service-three"`, - "5: sync remote: services: command stderr:\nfake stderr", + `4: services: running "/bin/systemctl" "daemon-reload"`, + "3: services: starting service-one service-three", + `4: services: running "/bin/systemctl" "start" "--" "service-one" "service-three"`, + "3: services: enabling service-two service-three", + `4: services: running "/bin/systemctl" "enable" "--" "service-two" "service-three"`, + "5: services: command stderr:\nfake stderr", }, safcm.MsgSyncResp{ ServiceChanges: []safcm.ServiceChange{ @@ -352,9 +352,9 @@ LoadError= Stderr: &bytes.Buffer{}, }}, []string{ - "4: sync remote: services: checking service-one service-two service-three (systemd detected)", - `4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`, - `5: sync remote: services: command stdout: + "4: services: checking service-one service-two service-three (systemd detected)", + `4: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`, + `5: services: command stdout: ActiveState=inactive UnitFileState=enabled LoadError= @@ -457,9 +457,9 @@ LoadError= Stderr: &bytes.Buffer{}, }}, []string{ - "4: sync remote: services: checking service-one service-two service-three (systemd detected)", - `4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`, - `5: sync remote: services: command stdout: + "4: services: checking service-one service-two service-three (systemd detected)", + `4: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`, + `5: services: command stdout: ActiveState=inactive UnitFileState=enabled LoadError= @@ -472,10 +472,10 @@ ActiveState=failed UnitFileState=disabled LoadError= `, - `4: sync remote: services: running "/bin/systemctl" "daemon-reload"`, - "3: sync remote: services: starting service-one service-three", - `4: sync remote: services: running "/bin/systemctl" "start" "--" "service-one" "service-three"`, - "5: sync remote: services: command stderr:\nfake stderr", + `4: services: running "/bin/systemctl" "daemon-reload"`, + "3: services: starting service-one service-three", + `4: services: running "/bin/systemctl" "start" "--" "service-one" "service-three"`, + "5: services: command stderr:\nfake stderr", }, safcm.MsgSyncResp{ ServiceChanges: []safcm.ServiceChange{ diff --git a/cmd/safcm-remote/sync/sync.go b/cmd/safcm-remote/sync/sync.go index 706791f..91e24fd 100644 --- a/cmd/safcm-remote/sync/sync.go +++ b/cmd/safcm-remote/sync/sync.go @@ -40,41 +40,39 @@ type Sync struct { log *log.Logger } -const logPrefix = "sync remote:" - func Handle(req safcm.MsgSyncReq, runner run.Runner, fun log.LogFunc) safcm.MsgSyncResp { s := &Sync{ req: req, - log: log.NewLogger(logPrefix, fun), + log: log.NewLogger(fun), } s.cmd = run.NewCmd(runner, s.log) err := s.setDefaults() if err != nil { - s.resp.Error = fmt.Sprintf("%s %s", logPrefix, err) + s.resp.Error = fmt.Sprintf("%s", err) return s.resp } err = s.syncFiles() if err != nil { - s.resp.Error = fmt.Sprintf("%s files: %s", logPrefix, err) + s.resp.Error = fmt.Sprintf("files: %s", err) return s.resp } err = s.syncPackages() if err != nil { - s.resp.Error = fmt.Sprintf("%s packages: %s", logPrefix, err) + s.resp.Error = fmt.Sprintf("packages: %s", err) return s.resp } err = s.syncServices() if err != nil { - s.resp.Error = fmt.Sprintf("%s services: %s", logPrefix, err) + s.resp.Error = fmt.Sprintf("services: %s", err) return s.resp } err = s.syncCommands() if err != nil { - s.resp.Error = fmt.Sprintf("%s commands: %s", logPrefix, err) + s.resp.Error = fmt.Sprintf("commands: %s", err) return s.resp } return s.resp diff --git a/cmd/safcm-remote/sync/sync_test.go b/cmd/safcm-remote/sync/sync_test.go index 17ba044..2571340 100644 --- a/cmd/safcm-remote/sync/sync_test.go +++ b/cmd/safcm-remote/sync/sync_test.go @@ -123,7 +123,7 @@ func prepareSync(req safcm.MsgSyncReq, runner *testRunner) ( res.wg.Done() }() - logger := log.NewLogger(logPrefix, + logger := log.NewLogger( func(level safcm.LogLevel, msg string) { res.ch <- fmt.Sprintf("%d: %s", level, msg) }) diff --git a/cmd/safcm/main_sync_test.go b/cmd/safcm/main_sync_test.go index 8726307..16aad16 100644 --- a/cmd/safcm/main_sync_test.go +++ b/cmd/safcm/main_sync_test.go @@ -177,9 +177,9 @@ func TestSyncSshEndToEnd(t *testing.T) { `[info] [no-changes.example.org] remote helper upload in progress [verbose] [no-changes.example.org] host groups: all no-changes.example.org [verbose] [no-changes.example.org] host group priorities (descending): no-changes.example.org -[debug] [no-changes.example.org] sync remote: files: "/" (no-changes.example.org): unchanged -[debug] [no-changes.example.org] sync remote: files: "/etc" (no-changes.example.org): unchanged -[debug] [no-changes.example.org] sync remote: files: "/tmp" (no-changes.example.org): unchanged +[debug] [no-changes.example.org] files: "/" (no-changes.example.org): unchanged +[debug] [no-changes.example.org] files: "/etc" (no-changes.example.org): unchanged +[debug] [no-changes.example.org] files: "/tmp" (no-changes.example.org): unchanged [info] [no-changes.example.org] no changes `, nil, @@ -202,9 +202,9 @@ func TestSyncSshEndToEnd(t *testing.T) { `[info] [no-changes.example.org] remote helper upload in progress [verbose] [no-changes.example.org] host groups: all no-changes.example.org [verbose] [no-changes.example.org] host group priorities (descending): no-changes.example.org -[debug] [no-changes.example.org] sync remote: files: "/" (no-changes.example.org): unchanged -[debug] [no-changes.example.org] sync remote: files: "/etc" (no-changes.example.org): unchanged -[debug] [no-changes.example.org] sync remote: files: "/tmp" (no-changes.example.org): unchanged +[debug] [no-changes.example.org] files: "/" (no-changes.example.org): unchanged +[debug] [no-changes.example.org] files: "/etc" (no-changes.example.org): unchanged +[debug] [no-changes.example.org] files: "/tmp" (no-changes.example.org): unchanged [info] [no-changes.example.org] no changes `, nil, @@ -260,10 +260,10 @@ executed 2 command(s): `[info] [no-effect-commands.example.org] remote helper upload in progress [verbose] [no-effect-commands.example.org] host groups: all no-effect-commands.example.org [verbose] [no-effect-commands.example.org] host group priorities (descending): no-effect-commands.example.org -[verbose] [no-effect-commands.example.org] sync remote: commands: running "/bin/sh" "-c" "echo this is a command" (no-effect-commands.example.org) -[debug2] [no-effect-commands.example.org] sync remote: commands: command output: +[verbose] [no-effect-commands.example.org] commands: running "/bin/sh" "-c" "echo this is a command" (no-effect-commands.example.org) +[debug2] [no-effect-commands.example.org] commands: command output: this is a command -[verbose] [no-effect-commands.example.org] sync remote: commands: running "/bin/sh" "-c" "true" (no-effect-commands.example.org) +[verbose] [no-effect-commands.example.org] commands: running "/bin/sh" "-c" "true" (no-effect-commands.example.org) [info] [no-effect-commands.example.org] executed 2 command(s): "echo this is a command": @@ -313,7 +313,7 @@ executed 2 command(s): > this is a command "echo failing; false", failed: "exit status 1": > failing -[error] [no-effect-commands-failing.example.org] sync remote: commands: "echo failing; false" failed: exit status 1 +[error] [no-effect-commands-failing.example.org] commands: "echo failing; false" failed: exit status 1 `, fmt.Errorf("exit status 1"), }, @@ -325,11 +325,11 @@ executed 2 command(s): `[info] [no-effect-commands-failing.example.org] remote helper upload in progress [verbose] [no-effect-commands-failing.example.org] host groups: all no-effect-commands-failing.example.org [verbose] [no-effect-commands-failing.example.org] host group priorities (descending): no-effect-commands-failing.example.org -[verbose] [no-effect-commands-failing.example.org] sync remote: commands: running "/bin/sh" "-c" "echo this is a command" (no-effect-commands-failing.example.org) -[debug2] [no-effect-commands-failing.example.org] sync remote: commands: command output: +[verbose] [no-effect-commands-failing.example.org] commands: running "/bin/sh" "-c" "echo this is a command" (no-effect-commands-failing.example.org) +[debug2] [no-effect-commands-failing.example.org] commands: command output: this is a command -[verbose] [no-effect-commands-failing.example.org] sync remote: commands: running "/bin/sh" "-c" "echo failing; false" (no-effect-commands-failing.example.org) -[debug2] [no-effect-commands-failing.example.org] sync remote: commands: command output: +[verbose] [no-effect-commands-failing.example.org] commands: running "/bin/sh" "-c" "echo failing; false" (no-effect-commands-failing.example.org) +[debug2] [no-effect-commands-failing.example.org] commands: command output: failing [info] [no-effect-commands-failing.example.org] executed 2 command(s): @@ -337,7 +337,7 @@ executed 2 command(s): > this is a command "echo failing; false", failed: "exit status 1": > failing -[error] [no-effect-commands-failing.example.org] sync remote: commands: "echo failing; false" failed: exit status 1 +[error] [no-effect-commands-failing.example.org] commands: "echo failing; false" failed: exit status 1 `, fmt.Errorf("exit status 1"), }, -- 2.45.2