diff options
author | Tim Smith <tsmith@chef.io> | 2017-09-15 09:27:13 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-09-15 09:27:13 -0700 |
commit | fae4135fa802fb3cc51006eac35ec8825d03e5b5 (patch) | |
tree | be8dd7112d8a50067c4a2c6abdce40bef69f4cfd | |
parent | 2d5f77d920ef8036b5d5610458374cb38d72761d (diff) | |
download | ohai-ipv6_colon_regex.tar.gz |
Fix the route support for IPV6 routes ending in ::ipv6_colon_regex
Removing the ending word boundary in the regex allows is to capture the
:: endings while still properly parsing other routes. I added a rubular
comment as well so we know what this regex is actually trying to
capture.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/linux/network.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb index 32a89133..296941fb 100644 --- a/lib/ohai/plugins/linux/network.rb +++ b/lib/ohai/plugins/linux/network.rb @@ -104,7 +104,8 @@ Ohai.plugin(:Network) do route_entry = Mash.new(:destination => route_dest, :family => family[:name]) %w{via scope metric proto src}.each do |k| - route_entry[k] = $1 if route_ending =~ /\b#{k}\s+([^\s]+)\b/ + # http://rubular.com/r/pwTNp65VFf + route_entry[k] = $1 if route_ending =~ /\b#{k}\s+([^\s]+)/ end # a sanity check, especially for Linux-VServer, OpenVZ and LXC: |