From 3d5fcfbcbc8a9c6b6de4b1e32306bf71cbda8e65 Mon Sep 17 00:00:00 2001 From: Joseph Milla Date: Wed, 26 Jun 2019 15:57:44 -0700 Subject: Make state regex less restrictive --- lib/ohai/plugins/linux/network.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb index 685b64aa..e0b6359c 100644 --- a/lib/ohai/plugins/linux/network.rb +++ b/lib/ohai/plugins/linux/network.rb @@ -276,7 +276,7 @@ Ohai.plugin(:Network) do end end - if line =~ /state (\w+)/ + if line =~ /\sstate (\w+)/ iface[tmp_int]["state"] = $1.downcase end end -- cgit v1.2.1 From d65295f24995d8b41599990e1c3878120169bcda Mon Sep 17 00:00:00 2001 From: Joseph Milla Date: Thu, 27 Jun 2019 10:19:41 -0700 Subject: Add rubular link Signed-off-by: Joseph Milla --- lib/ohai/plugins/linux/network.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb index e0b6359c..70937635 100644 --- a/lib/ohai/plugins/linux/network.rb +++ b/lib/ohai/plugins/linux/network.rb @@ -276,6 +276,7 @@ Ohai.plugin(:Network) do end end + # https://rubular.com/r/JRp6lNANmpcLV5 if line =~ /\sstate (\w+)/ iface[tmp_int]["state"] = $1.downcase end -- cgit v1.2.1