Puppet: System Administration Automated

Support

Ticket #888 (closed defect: duplicate)

Opened 10 months ago

Last modified 10 months ago

Facter (ipmess.rb) truncating Xen virtual interfaces

Reported by: ja8sun Assigned to: community
Priority: normal Milestone:
Component: client Version:
Severity: normal Keywords: xen facter interfaces virtual
Cc: Triage Stage: Accepted
Attached Patches: Code Complexity: Unknown

Description

Facter 1.3.8 has a module called ipmess.rb that does not handle interface names with decimals, hence Xen virtual interfaces names get truncated. Therefore, dubious errors are displayed when ipmess.rb goes to do an ifconfig on interface vif3 instead of vif3.0.

Example: Output of ifconfig -a to show Xen virtual interfaces

# ifconfig -a  (output has been shorten for brevity)
vif0.1    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

vif0.2    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

vif0.3    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
Output to show facter version and errors
# facter -v
vif0: error fetching interface information: Device not found
vif0: error fetching interface information: Device not found
vif0: error fetching interface information: Device not found
vif0: error fetching interface information: Device not found
vif1: error fetching interface information: Device not found
vif2: error fetching interface information: Device not found
vif3: error fetching interface information: Device not found
vif7: error fetching interface information: Device not found
1.3.8

Proposed patch:

*** ipmess.rb   2007-09-24 03:00:05.000000000 -0400
--- /tmp/ipmess.rb      2007-11-04 17:00:44.000000000 -0500
***************
*** 21,27 ****
  
         output = %x{/sbin/ifconfig -a}
         int = nil
!         output.scan(/^(\w+)(\d+)/) { |str|
           output_int = %x{/sbin/ifconfig #{str}}
           int = "#{str}"
           tmp1 = nil
--- 21,27 ----
  
         output = %x{/sbin/ifconfig -a}
         int = nil
!         output.scan(/^(\w+)(\d+)(\.?)(\d+)*/) { |str|
           output_int = %x{/sbin/ifconfig #{str}}
           int = "#{str}"
           tmp1 = nil

Attachments

ipmess.patch (0.6 kB) - added by ja8sun on 11/04/07 23:35:17.

Change History

11/04/07 23:35:17 changed by ja8sun

  • attachment ipmess.patch added.

11/05/07 00:44:53 changed by jamtur01

  • status changed from new to closed.
  • resolution set to duplicate.
  • stage changed from Unreviewed to Accepted.

Agree there is an issue. Have moved bug to Facter trac and re-created.