Skip to content

Commit

Permalink
Only consider gigabit Ethernet ports for discovery and undercloud con…
Browse files Browse the repository at this point in the history
…trol plane
  • Loading branch information
VictorLowther committed Mar 20, 2015
1 parent bc2040f commit 5d90574
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5d90574

Please sign in to comment.