core: add more debug info to the prepare pod

When running the device property commands, let's also log their results
for better debugging/visibility.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 77b2e10c14)
This commit is contained in:
Sébastien Han authored and Mergify committed 2022-05-10 00:07:58 +00:00
1 parent b75364f19e
commit c2f7e85126
1 file changed
+3 -1
+3 -1
View File
@@ -208,11 +208,12 @@ func GetDeviceProperties(device string, executor exec.Executor) (map[string]stri
// GetDevicePropertiesFromPath gets a device property from a path
func GetDevicePropertiesFromPath(devicePath string, executor exec.Executor) (map[string]string, error) {
output, err := executor.ExecuteCommandWithOutput("lsblk", devicePath,
"--bytes", "--nodeps", "--pairs", "--paths", "--output", "SIZE,ROTA,RO,TYPE,PKNAME,NAME,KNAME")
"--bytes", "--nodeps", "--pairs", "--paths", "--output", "SIZE,ROTA,RO,TYPE,PKNAME,NAME,KNAME,MOUNTPOINT,FSTYPE")
if err != nil {
logger.Errorf("failed to execute lsblk. output: %s", output)
return nil, err
}
logger.Debugf("lsblk output: %q", output)
return parseKeyValuePairString(output), nil
}
@@ -236,6 +237,7 @@ func GetUdevInfo(device string, executor exec.Executor) (map[string]string, erro
if err != nil {
return nil, err
}
logger.Debugf("udevadm info output: %q", output)
return parseUdevInfo(output), nil
}