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
This commit is contained in:
Ryan Moe 2014-04-18 12:29:28 -07:00
parent 843174fb4f
commit 622487c5d5
1 changed files with 1 additions and 1 deletions

View File

@ -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}