From ac30d1b2423a992e433a4ba2b167be399754c147 Mon Sep 17 00:00:00 2001 From: dheerajd-msys Date: Tue, 6 Aug 2019 11:14:34 +0530 Subject: fix review comments Signed-off-by: dheerajd-msys --- lib/chef/provider/ifconfig.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb index a3b63a5490..1334b16fe6 100644 --- a/lib/chef/provider/ifconfig.rb +++ b/lib/chef/provider/ifconfig.rb @@ -109,9 +109,11 @@ class Chef # RX errors 0 dropped 0 overruns 0 frame 0 # TX packets 1244218 bytes 977339327 (932.0 MiB) # TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + # + # Permalink for addr_regex : https://rubular.com/r/JrykUpfjRnYeQD @status = shell_out("ifconfig") @status.stdout.each_line do |line| - addr_regex = /^(\w+)(-?):?(\d*):?\ .+$/ + addr_regex = /^((\w|-)+):?(\d*):?\ .+$/ if line =~ addr_regex if line.match(addr_regex).nil? @int_name = "nil" -- cgit v1.2.1