diff --git a/cmd/root.go b/cmd/root.go index a716fbdf..24c5296c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -73,6 +73,12 @@ func Run(spec *Specification, hal hal.InBand) (*event.EventEmitter, error) { hammer.Spec.ConsolePassword = password.Generate(16) + err = hammer.createBmcSuperuser() + if err != nil { + log.Error("failed to update bmc superuser password", "error", err) + return eventEmitter, err + } + n := &network.Network{ MachineUUID: spec.MachineUUID, IPAddress: spec.IP, @@ -116,12 +122,6 @@ func Run(spec *Specification, hal hal.InBand) (*event.EventEmitter, error) { } hammer.GrpcClient = grpcClient - err = hammer.createBmcSuperuser() - if err != nil { - log.Error("failed to update bmc superuser password", "error", err) - return eventEmitter, err - } - m, err := hammer.fetchMachine(spec.MachineUUID) if err == nil && m != nil && m.Allocation != nil && m.Allocation.Reinstall != nil && *m.Allocation.Reinstall { primaryDiskWiped := false