Merge branch 'main' of github.com:ctrl-cmd/warewulf into main
This commit is contained in:
@@ -34,6 +34,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
|
||||
for _, node := range nodeList {
|
||||
|
||||
var powerCmd power.PowerOnInterface
|
||||
|
||||
if node.IpmiIpaddr.String() == "" {
|
||||
wwlog.Printf(wwlog.ERROR, "%s: No IPMI IP address\n", node.HostName)
|
||||
continue
|
||||
@@ -46,7 +48,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
AuthType: "MD5",
|
||||
}
|
||||
|
||||
out, err := ipmiCmd.PowerOn()
|
||||
powerCmd = ipmiCmd
|
||||
|
||||
out, err := powerCmd.PowerOn()
|
||||
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "%s: %s\n", node.HostName, out)
|
||||
|
||||
22
internal/pkg/power/power.go
Normal file
22
internal/pkg/power/power.go
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
package power
|
||||
|
||||
//type PowerControl interface {
|
||||
//PowerOn() (result string, err error)
|
||||
//PowerOff() (result string, err error)
|
||||
//PowerStatus() (result string, err error)
|
||||
//}
|
||||
|
||||
type PowerOnInterface interface {
|
||||
PowerOn() (result string, err error)
|
||||
}
|
||||
|
||||
type PowerOffInterface interface {
|
||||
PowerOff() (result string, err error)
|
||||
}
|
||||
|
||||
type PowerStatusInterface interface {
|
||||
PowerStatus() (result string, err error)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user