func (b *Butler) executeCommand(command string, asset *asset.Asset) (err error) {
	component := "executeCommand"
	log := b.Log
	if b.Config.DryRun {
		log.WithFields(logrus.Fields{
			"component": component,
			"Asset":     fmt.Sprintf("%+v", asset),
		}).Info("Dry run, won't execute cmd on asset.")
		return nil
	}
	bmcConn := bmclogin.Params{
		IpAddresses:     asset.IPAddresses,
		Credentials:     b.Config.Credentials,
		CheckCredential: false,
		Retries:         1,
	}
	client, loginInfo, err := bmcConn.Login()
	if err != nil {
		return err
	}
	asset.IPAddress = loginInfo.ActiveIpAddress
	switch client.(type) {
	case devices.Bmc:
		bmc := client.(devices.Bmc)
		success, output, err := b.executeCommandBmc(bmc, command)
		if err != nil || !success {
			log.WithFields(logrus.Fields{
				"component":          component,
				"Serial":             asset.Serial,
				"Asset Type":         asset.Type,
				"Vendor":             asset.Vendor,  
				"Location":           asset.Location,
				"IP Address":         asset.IPAddress,
				"Command":            command,
				"Command Successful": success,
				"Error":              err,
				"Output":             output,
			}).Warn("Command execute returned error.")
		} else {
			log.WithFields(logrus.Fields{
				"component":          component,
				"Serial":             asset.Serial,
				"Asset Type":         asset.Type,
				"Vendor":             asset.Vendor,
				"Location":           asset.Location,
				"IP Address":         asset.IPAddress,
				"Command":            command,
				"Command Successful": success,
				"Output":             output,
			}).Debug("Command successfully executed.")
		}
		bmc.Close(context.TODO())
	case devices.Cmc:
		chassis := client.(devices.Cmc)
		log.WithFields(logrus.Fields{
			"component": component,
			"Asset":     fmt.Sprintf("%+v", asset),
		}).Info("Command executed.")
		chassis.Close()
	default:
		log.WithFields(logrus.Fields{
			"component": component,
			"Asset":     fmt.Sprintf("%+v", asset),
		}).Warn("Unknown device type.")
		return errors.New("unknown asset type")
	}
	return err
}
applyConfig setups up the bmc connection
gets any config templated data rendered
applies the configuration using bmclib
package butler
import (
	"context"
	"errors"
	"fmt"
	"github.com/sirupsen/logrus"
	"github.com/bmc-toolbox/bmclib/devices"
	"github.com/bmc-toolbox/bmclogin"
	"github.com/bmc-toolbox/bmcbutler/pkg/asset"
)