diff --git a/pkg/baremetal/manager.go b/pkg/baremetal/manager.go index 3f2ccfa1f9e..16570b6f793 100644 --- a/pkg/baremetal/manager.go +++ b/pkg/baremetal/manager.go @@ -1311,8 +1311,10 @@ func (b *SBaremetalInstance) GetTask() tasks.ITask { func (b *SBaremetalInstance) SetTask(task tasks.ITask) { b.taskQueue.AppendTask(task) if reflect.DeepEqual(task, b.taskQueue.GetTask()) { - log.Infof("Set task equal, ExecuteTask %s", task.GetName()) + log.Infof("[Baremetal %s] Set task equal, ExecuteTask %s", b.GetId(), task.GetName()) tasks.ExecuteTask(task, nil) + } else { + log.Warningf("[Baremetal %s] task queue is not empty: %s", b.GetId(), b.taskQueue.String()) } } diff --git a/pkg/baremetal/tasks/base.go b/pkg/baremetal/tasks/base.go index 86623275695..30095008bf5 100644 --- a/pkg/baremetal/tasks/base.go +++ b/pkg/baremetal/tasks/base.go @@ -80,11 +80,20 @@ func (q *Queue) String() string { return fmt.Sprintf("%v", itemStrings) } +type iStringer interface { + String() string +} + func debugString(elem *list.Element) []string { if elem == nil { return nil } + val := elem.Value + valStr, ok := val.(iStringer) strings := []string{fmt.Sprintf("%v", elem.Value)} + if ok { + strings[0] = valStr.String() + } rest := debugString(elem.Next()) if rest != nil { strings = append(strings, rest...)