summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-08-23 06:22:41 -0400
committerdheerajd-msys <dheeraj.dubey@msystechnologies.com>2020-02-27 14:29:31 +0530
commit07b6040ab2df749145651f9a91c567a0a8a59c45 (patch)
treed243dc8a75ca6806913169fa2f28837200a6720a
parenta718989b9e0fefdaca9fdb8d46030e06da51c71f (diff)
downloadchef-07b6040ab2df749145651f9a91c567a0a8a59c45.tar.gz
Backport:ifconfig: fix regex matching interface name with hyphen
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
-rw-r--r--lib/chef/provider/ifconfig.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/ifconfig.rb b/lib/chef/provider/ifconfig.rb
index 607f1fa47b..1575127c25 100644
--- a/lib/chef/provider/ifconfig.rb
+++ b/lib/chef/provider/ifconfig.rb
@@ -112,7 +112,7 @@ class Chef
# 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"