Bug #2938

interfaces that don't match ^\w+[.:]?\d+ are ignored

Added by Andy Bakun over 2 years ago. Updated about 2 years ago.

Status:Closed Start date:12/16/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:library
Target version:1.5.8
Keywords: Affected Facter version:
Branch:
Votes: 2

Description

I often rename the interfaces on my machines so they are more self-documenting and consistent independent of driver loading order.

This can be done with @ip link set DEVICE name NEWNAME@ or with udev rules (the more permanent option).

The regular expression used to match is too limiting on line 24 of facter/ipmess.rb in facter 1.3.8 (I’m currently using a ubuntu provided facter), but still exists in line 55 of http://projects.reductivelabs.com/projects/facter/repository/revisions/fab9d1c63f0a3671dc5f8fa0233823a59f1bce06/entry/lib/facter/util/ip.rb

This would most likely be easier to parse the output of @ip link@ and @ip addr@ using iproute2 (/sbin/ip), which is mentioned in bug #1346. So this bug may be dependent on that one.

hyphen.patch (903 Bytes) Tim Sharpe, 12/17/2009 10:24 pm


Related issues

related to Facter - Bug #1346: Using 'ip addr' over ifconfig Code Insufficient 06/03/2008
duplicated by Facter - Bug #4431: interfaces does not include interfaces that do not end in... Duplicate 08/01/2010

History

Updated by Tim Sharpe over 2 years ago

This is also causing me some unnecessary noise as I have a few bridges configured on my Xen servers that have hyphens in their names. I’ve attached a quick patch that works on my systems.

Wasn’t sure if this should be a separate issue or not (the base issue is the same). Preemptive sorry if it should have been.

Updated by James Turnbull over 2 years ago

  • Category set to library
  • Status changed from Unreviewed to Accepted
  • Target version set to 1.6.0

Updated by James Turnbull over 2 years ago

  • Target version changed from 1.6.0 to 1.5.8

Updated by Paul Nasrat over 2 years ago

  • Status changed from Accepted to Needs More Information

I’m wondering if we should use sysfs to enumerate the device names does:

ls /sys/class/net contain the correct information in your setup with device renaming?

Updated by Andy Bakun over 2 years ago

The symlinks in /sys/class/net do seem to mirror the names assigned by udev and “ip link set name”. I changed the name of a device on the system using “ip link” and it was immediately mirrored in the /sys/class/net structure. This would make finding the devices as straight forward as iterating over the contents of this dir looking for symlinks.

Updated by James Turnbull about 2 years ago

  • Status changed from Needs More Information to Closed

Pushed in commit:e19024bbef18a4a2053537415bfe16bfaff00b8a in branch master.

Also available in: Atom PDF