summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphreakocious <phreakocious@gmxxxx.com>2015-12-14 18:01:44 +0000
committerphreakocious <phreakocious@gmxxxx.com>2015-12-14 18:01:44 +0000
commitc2051dcb50872462ca3df19f13ca9cd513ccc18c (patch)
tree3f82f26e68840b87c4120c1ce2d3522e8191e537
parentafd42e9122f057ab00dd24357c28dc2ad6806434 (diff)
downloadohai-c2051dcb50872462ca3df19f13ca9cd513ccc18c.tar.gz
this offends my sense of English language aesthetics, but changing hyphens to underscores... thanks, Matz.
-rw-r--r--lib/ohai/plugins/linux/network.rb2
-rw-r--r--spec/unit/plugins/linux/network_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index 94bcc7a3..689001dc 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -150,7 +150,7 @@ Ohai.plugin(:Network) do
line.lstrip!
k, v = line.split(': ')
next unless keys.include? k
- k.downcase!
+ k.downcase!.tr!('-', '_')
if k == 'speed'
k = 'link_speed' # This is not necessarily the maximum speed the NIC supports
v = v[/\d+/].to_i
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index 2efe05aa..de5a89ce 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -383,8 +383,8 @@ fe80::21c:eff:fe12:3456 dev eth0.153 lladdr 00:1c:0e:30:28:00 router REACHABLE
expect(plugin['network']['interfaces']['eth0']['duplex']).to eq('Full')
expect(plugin['network']['interfaces']['eth0']['port']).to eq('FIBRE')
expect(plugin['network']['interfaces']['eth0']['transceiver']).to eq('external')
- expect(plugin['network']['interfaces']['eth0']['auto-negotiation']).to eq('on')
- expect(plugin['network']['interfaces']['eth0']['mdi-x']).to be_nil
+ expect(plugin['network']['interfaces']['eth0']['auto_negotiation']).to eq('on')
+ expect(plugin['network']['interfaces']['eth0']['mdi_x']).to be_nil
end
it "detects the ipv4 addresses of the ethernet interface" do