From 99a478f8f1025f4cc6433e600bf031d51edfa3f1 Mon Sep 17 00:00:00 2001 From: Omar Othman Date: Fri, 12 Mar 2021 19:34:44 +0100 Subject: [PATCH] Adding the context to bmc.Close(). --- pkg/butler/configure.go | 3 ++- pkg/butler/configure/server.go | 3 ++- pkg/butler/execute.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/butler/configure.go b/pkg/butler/configure.go index 351f1db6..80e2475f 100644 --- a/pkg/butler/configure.go +++ b/pkg/butler/configure.go @@ -1,6 +1,7 @@ package butler import ( + "context" "errors" "fmt" "time" @@ -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) diff --git a/pkg/butler/configure/server.go b/pkg/butler/configure/server.go index f4c045a0..2e206911 100644 --- a/pkg/butler/configure/server.go +++ b/pkg/butler/configure/server.go @@ -1,6 +1,7 @@ package configure import ( + "context" "strings" "github.com/bmc-toolbox/bmcbutler/pkg/asset" @@ -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() diff --git a/pkg/butler/execute.go b/pkg/butler/execute.go index 691a0b74..0a9e8c8d 100644 --- a/pkg/butler/execute.go +++ b/pkg/butler/execute.go @@ -1,6 +1,7 @@ package butler import ( + "context" "errors" "fmt" @@ -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)