From b49d4fd3563f77f02d9e95ec06106c5686d02450 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Mon, 9 Sep 2024 09:23:29 +0200 Subject: [PATCH] Stringify --- pixiecore/booters.go | 2 +- pixiecore/dhcp.go | 2 +- pixiecore/pixiecore.go | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pixiecore/booters.go b/pixiecore/booters.go index d4ba96e..1995971 100644 --- a/pixiecore/booters.go +++ b/pixiecore/booters.go @@ -80,7 +80,7 @@ type grpcbooter struct { // BootSpec implements Booter func (g *grpcbooter) BootSpec(m Machine) (*Spec, error) { - g.log.Info("bootspec", "machine", m) + g.log.Info("bootspec", "machine", m.String()) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() diff --git a/pixiecore/dhcp.go b/pixiecore/dhcp.go index b7f9d4a..d58d940 100644 --- a/pixiecore/dhcp.go +++ b/pixiecore/dhcp.go @@ -55,7 +55,7 @@ func (s *Server) serveDHCP(conn *dhcp4.Conn) error { continue } - s.Log.Info("Offering to boot", "mac", pkt.HardwareAddr) + s.Log.Info("Offering to boot", "mac", pkt.HardwareAddr.String()) if fwtype == FirmwarePixiecoreIpxe { s.machineEvent(pkt.HardwareAddr, machineStateProxyDHCPIpxe, "Offering to boot iPXE") } else { diff --git a/pixiecore/pixiecore.go b/pixiecore/pixiecore.go index 9296989..03cf717 100644 --- a/pixiecore/pixiecore.go +++ b/pixiecore/pixiecore.go @@ -77,6 +77,10 @@ type Machine struct { GUID string } +func (m Machine) String() string { + return fmt.Sprintf("mac:%s arch:%s guid:%s", m.MAC.String(), m.Arch.String(), m.GUID) +} + // A Spec describes a kernel and associated configuration. type Spec struct { // The kernel to boot