Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
slntopp committed Jan 6, 2025
1 parent 5db2c87 commit bd85bcf
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions providers/os/connection/device/linux/device_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"fmt"
"io"
"os"
"os/exec"
"path"
"path/filepath"
"sort"
Expand Down Expand Up @@ -160,48 +159,6 @@ func (d *LinuxDeviceManager) attemptFindFstab(dir string) ([]resources.FstabEntr
return nil, nil
}

debug := func() {
stderr, err := io.ReadAll(cmd.Stderr)
if err != nil {
log.Error().Err(err).
Int("exit-status", cmd.ExitStatus).
Msg("error reading find stderr")
} else {
log.Warn().Bytes("find-stderr", stderr).
Int("exit-status", cmd.ExitStatus).
Msg("!!! find stderr !!!")
}

cmd2 := exec.Command("find", dir, "-type", "f", "-wholename", `*/etc/fstab`)
out2, err := cmd2.CombinedOutput()
if err != nil {
log.Error().Err(err).Bytes("find", out2).Msg("error searching for fstab")
}
log.Warn().Bytes("find", out2).Msg("!!! find2 output !!!")

ls := exec.Command("ls", "-la", dir)
out, err := ls.CombinedOutput()
if err != nil {
log.Error().Err(err).Bytes("ls", out).Msg("error listing dir")
}
log.Warn().Bytes("ls", out).Msg("!!! ls output !!!")

ls = exec.Command("ls", "-la", path.Join(dir, "etc"))
out, err = ls.CombinedOutput()
if err != nil {
log.Error().Err(err).Bytes("ls", out).Msg("error listing dir")
}
log.Warn().Bytes("ls", out).Msg("!!! ls output !!!")

ls = exec.Command("ls", "-la", path.Join(dir, "root", "etc"))
out, err = ls.CombinedOutput()
if err != nil {
log.Error().Err(err).Bytes("ls", out).Msg("error listing dir")
}
log.Warn().Bytes("ls", out).Msg("!!! ls output !!!")
}
defer debug()

out, err := io.ReadAll(cmd.Stdout)
if err != nil {
log.Error().Err(err).Msg("error reading find output")
Expand Down

0 comments on commit bd85bcf

Please sign in to comment.