From 622487c5d52e060371d91c10f9520f19aecfecfe Mon Sep 17 00:00:00 2001 From: Ryan Moe Date: Fri, 18 Apr 2014 12:29:28 -0700 Subject: [PATCH] Fix interface type check in nailgun agent The regular expression used in ohai to determine interface type doesn't work with interfaces containing more than one digit (e.g. eth10). Consequently the "type" is returned as eth1 instead of eth for all interfaces above eth9 and the agent skips them. Ohai bug here: https://tickets.opscode.com/browse/OHAI-571 Change-Id: Ib302542255ec25bee43e4f012d66658219ec1710 Closes-bug: #1308036 --- bin/agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/agent b/bin/agent index 24114e0ec7..8176b42080 100755 --- a/bin/agent +++ b/bin/agent @@ -198,7 +198,7 @@ class NodeAgent begin (@os[:network][:interfaces] or {} rescue {}).each do |int, intinfo| # Send info about physical interfaces only - next if intinfo[:type] != "eth" + next if intinfo[:type] !~ /^eth.*/ # Exception: eth0.0(example) have "type" => "eth" but it is not physical interface next if int =~ /\d+\.\d+$/ or int =~ /vlan\d+$/ int_meta = {:name => int}