Merge branch 'main' of github.com:ctrl-cmd/warewulf into main

This commit is contained in:
Gregory Kurtzer
2020-12-01 13:06:42 -08:00
5 changed files with 123 additions and 3 deletions

View File

@@ -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)

View 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)
}