From 5d90574f2b483bcd7816cca7adccab781cf0efdb Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Fri, 20 Mar 2015 14:10:37 -0500 Subject: [PATCH] Only consider gigabit Ethernet ports for discovery and undercloud control plane --- main.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index f366228..afbcd30 100644 --- a/main.go +++ b/main.go @@ -152,12 +152,21 @@ func getBootNic(client *wsman.Client, nics []*dom.Element) *dom.Element { os.Exit(1) } fqdd := string(n.Content) // Only care about integrated nics - if strings.HasPrefix(fqdd, "NIC.Integrated.") { - fqdds = append(fqdds, fqdd) + if ! strings.HasPrefix(fqdd, "NIC.Integrated.") { + log.Printf("%s is not integrated, skipping\n",fqdd) + continue + } + speed := search.First(search.Tag("LinkSpeed","*"),nic.Children()) + // If there is not speed setting, then the server is too old to report it. + // Happily enough, that also means it is too old for 10 gig ports to be a thing. + if speed != nil && string(speed.Content) != "3" { + log.Printf("%s is not a gigabit Ethernet port\n",fqdd) + continue } + fqdds = append(fqdds, fqdd) } if len(fqdds) < 1 { - log.Printf("No integrated nics!") + log.Printf("No integrated 1 GB nics!") os.Exit(1) } sort.Strings(fqdds)