Closed byxorna closed 7 years ago
I like this since it will also work with the strange 25GbE and 50GbE cards that could pop up in the DC.
Can we remove *GbNic functions all together instead of deprecating them? It looks like the only place they are used is in tests and show_overview.html which should be easy to switch over.
eatingthenight@lix:~/Code/collins$ grep -r hasGbNic .
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.hasGbNic must beTrue
./app/collins/util/LshwRepresentation.scala: def hasGbNic: Boolean = nics.find { _.speed.inGigabits == 1 }.map { _ => true }.getOrElse(false)
./app/collins/util/LshwRepresentation.scala: (hasGbNic == other.hasGbNic) &&
eatingthenight@lix:~/Code/collins$ grep -r has10GbNic .
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic aka "has 10 gig card" must beTrue // picked up from default in config
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala: rep.has10GbNic must beFalse
./app/views/asset/show_overview.scala.html: <td>@{if (aa.lshw.has10GbNic) "Yes" else "No"}</td>
./app/collins/util/LshwRepresentation.scala: def has10GbNic: Boolean = nics.find { _.speed.inGigabits == 10 }.map { _ => true }.getOrElse(false)
./app/collins/util/LshwRepresentation.scala: (has10GbNic == other.has10GbNic)
@michaeljs1990 yea, i was going to but wanted to put up the most simple diff first. I am game to gut those unnecessary methods. Next push will include that.
@michaeljs1990 removed unnecessary methods :)
Fixes #545
@michaeljs1990 This updates the show overview to indicate how many of each capacity interface are present. For example, if a machine has 4x1g and 1x10g interfaces, the show overview will reflect this in a terse manner. Similarly, a machine with 1x40g nic will show that it includes a 40g nic, instead of reporting it does not have a 10g.
cc @defect @roymarantz @gtorre @qx-xp
Homogenous interfaces:![screenshot from 2017-05-20 14-09-33](https://cloud.githubusercontent.com/assets/130194/26275648/073fc1de-3d66-11e7-9f18-cdf1af6d26ee.png)
Mixed interfaces:![screenshot from 2017-05-20 14-19-14](https://cloud.githubusercontent.com/assets/130194/26275713/7d2399e2-3d67-11e7-800f-50d39a1d10b5.png)