Skip to content

Commit

Permalink
Adding the context to bmc.Close().
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar Othman committed Apr 5, 2021
1 parent cb4ebf6 commit 99a478f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/butler/configure.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package butler

import (
"context"
"errors"
"fmt"
"time"
Expand Down Expand Up @@ -80,7 +81,7 @@ func (b *Butler) configureAsset(config []byte, asset *asset.Asset) (err error) {
c := configure.NewBmcConfigurator(bmc, asset, b.Config.Resources, renderedConfig, b.Config, b.StopChan, log)
c.Apply()

bmc.Close()
bmc.Close(context.TODO())
case devices.Cmc:
chassis := client.(devices.Cmc)

Expand Down
3 changes: 2 additions & 1 deletion pkg/butler/configure/server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package configure

import (
"context"
"strings"

"github.com/bmc-toolbox/bmcbutler/pkg/asset"
Expand Down Expand Up @@ -191,7 +192,7 @@ func (b *Bmc) Apply() {
}).Info("BMC to be reset.")

// Close the current connection - so we don't leave connections hanging.
b.bmc.Close()
b.bmc.Close(context.TODO())

//// reset BMC using SSH.
_, err := b.bmc.PowerCycleBmc()
Expand Down
3 changes: 2 additions & 1 deletion pkg/butler/execute.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package butler

import (
"context"
"errors"
"fmt"

Expand Down Expand Up @@ -70,7 +71,7 @@ func (b *Butler) executeCommand(command string, asset *asset.Asset) (err error)
}).Debug("Command executed.")

}
bmc.Close()
bmc.Close(context.TODO())
case devices.Cmc:
chassis := client.(devices.Cmc)
//b.executeCommandChassis(chassis, command)
Expand Down

0 comments on commit 99a478f

Please sign in to comment.