From ae3336bccbf8c70122355d3d305bfd5e49d531c2 Mon Sep 17 00:00:00 2001 From: Mikita Iwanowski Date: Fri, 13 Dec 2024 23:18:02 +0100 Subject: [PATCH] more debug logs --- providers/os/fs/fs.go | 2 ++ providers/os/id/sshhostkey/sshhostkey.go | 1 + 2 files changed, 3 insertions(+) diff --git a/providers/os/fs/fs.go b/providers/os/fs/fs.go index e9dd5891f2..c3d7944ad7 100644 --- a/providers/os/fs/fs.go +++ b/providers/os/fs/fs.go @@ -10,6 +10,7 @@ import ( "regexp" "time" + "github.com/rs/zerolog/log" "github.com/spf13/afero" ) @@ -53,6 +54,7 @@ func (t *MountedFs) MkdirAll(path string, perm os.FileMode) error { func (t *MountedFs) Open(name string) (afero.File, error) { mountedPath := t.getPath(name) + log.Debug().Str("mountedPath", mountedPath).Str("requestedPath", name).Msg("opening file") // debug f, e := os.Open(mountedPath) if f == nil { // while this looks strange, we need to return a bare nil (of type nil) not diff --git a/providers/os/id/sshhostkey/sshhostkey.go b/providers/os/id/sshhostkey/sshhostkey.go index b0ae426434..c0cb29f882 100644 --- a/providers/os/id/sshhostkey/sshhostkey.go +++ b/providers/os/id/sshhostkey/sshhostkey.go @@ -37,6 +37,7 @@ func Detect(t shared.Connection, p *inventory.Platform) ([]string, error) { log.Warn().Err(err).Str("hostkey", hostKeyFilePath).Msg("no permission to access ssh hostkey") continue } else if os.IsNotExist(err) { + log.Debug().Str("hostkey", hostKeyFilePath).Msg("ssh hostkey not found") // debug continue } else if err != nil { return nil, errors.Wrap(err, "could not read file:"+hostKeyFilePath)