core: fix info log for discovered devices
Fix the info log statement to log the discovered devices as their string representation instead of pointers. This changes the info log to only be the device names and the debug log to be the whole disk struct as well. Resolves #5625 Signed-off-by: Alexander Trost <galexrt@googlemail.com>
This commit is contained in:
1 file changed
+11
-1
@@ -395,14 +395,24 @@ func updateDeviceCM(context *clusterd.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func logDevices(devices []*sys.LocalDisk) {
|
||||
var devicesList []string
|
||||
for _, device := range devices {
|
||||
logger.Debugf("localdevice %q: %+v", device.Name, device)
|
||||
devicesList = append(devicesList, device.Name)
|
||||
}
|
||||
logger.Infof("localdevices: %q", strings.Join(devicesList, ", "))
|
||||
}
|
||||
|
||||
func probeDevices(context *clusterd.Context) ([]sys.LocalDisk, error) {
|
||||
devices := make([]sys.LocalDisk, 0)
|
||||
localDevices, err := clusterd.DiscoverDevices(context.Executor)
|
||||
logger.Infof("localdevices: %+v", localDevices)
|
||||
if err != nil {
|
||||
return devices, fmt.Errorf("failed initial hardware discovery. %+v", err)
|
||||
}
|
||||
|
||||
logDevices(localDevices)
|
||||
|
||||
// ceph-volume inventory command takes a little time to complete.
|
||||
// Get this data only if it is needed and once by function execution
|
||||
var cvInventory *map[string]string = nil
|
||||
|
||||
Reference in new issue
Block a user