@@ -62,26 +62,25 @@ func (c *Conn) FirmwareInstall(ctx context.Context, component, applyAt string, f
62
62
return "" , errors .Wrap (errInsufficientCtxTimeout , " " + time .Until (ctxDeadline ).String ())
63
63
}
64
64
65
- // TODO; uncomment once obmc support is implemented for tasks
66
65
// list redfish firmware install task if theres one present
67
- // task, err := c.GetFirmwareInstallTaskQueued(ctx, component)
68
- // if err != nil {
69
- // return "", err
70
- // }
71
- //
72
- // if task != nil {
73
- // msg := fmt.Sprintf("task for %s firmware install present: %s", component, task.ID)
74
- // c.Log.V(2).Info("warn", msg)
75
- //
76
- // if forceInstall {
77
- // err = c.purgeQueuedFirmwareInstallTask(ctx, component)
78
- // if err != nil {
79
- // return "", errors.Wrap(bmclibErrs.ErrFirmwareInstall, err.Error())
80
- // }
81
- // } else {
82
- // return "", errors.Wrap(bmclibErrs.ErrFirmwareInstall, msg)
83
- // }
84
- // }
66
+ task , err := c .GetFirmwareInstallTaskQueued (ctx , component )
67
+ if err != nil {
68
+ return "" , err
69
+ }
70
+
71
+ if task != nil {
72
+ msg := fmt .Sprintf ("task for %s firmware install present: %s" , component , task .ID )
73
+ c .Log .V (2 ).Info ("warn" , msg )
74
+
75
+ if forceInstall {
76
+ err = c .purgeQueuedFirmwareInstallTask (ctx , component )
77
+ if err != nil {
78
+ return "" , errors .Wrap (bmclibErrs .ErrFirmwareInstall , err .Error ())
79
+ }
80
+ } else {
81
+ return "" , errors .Wrap (bmclibErrs .ErrFirmwareInstall , msg )
82
+ }
83
+ }
85
84
86
85
// override the gofish HTTP client timeout,
87
86
// since the context timeout is set at Open() and is at a lower value than required for this operation.
0 commit comments