Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.2:Ports
rubygem-facter
facter-ip-interface.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File facter-ip-interface.patch of Package rubygem-facter
Index: facter-2.0.2/lib/facter/util/ip.rb =================================================================== --- facter-2.0.2.orig/lib/facter/util/ip.rb +++ facter-2.0.2/lib/facter/util/ip.rb @@ -73,7 +73,10 @@ module Facter::Util::IP def self.get_all_interface_output case Facter.value(:kernel) - when 'Linux', 'OpenBSD', 'NetBSD', 'FreeBSD', 'Darwin', 'GNU/kFreeBSD', 'DragonFly', 'AIX' + when 'Linux' + output = Facter::Util::IP.exec_ip(["link"]) + output.gsub!(/^\d+:\s*/, "") # delete leading number + when 'OpenBSD', 'NetBSD', 'FreeBSD', 'Darwin', 'GNU/kFreeBSD', 'DragonFly', 'AIX' output = Facter::Util::IP.exec_ifconfig(["-a","2>/dev/null"]) when 'SunOS' output = Facter::Util::IP.exec_ifconfig(["-a"]) @@ -92,6 +95,13 @@ module Facter::Util::IP ## + # exec_ip uses the Linux ip command + # + # @return [String] the output of `ip #{arguments} 2>/dev/null` or nil + def self.exec_ip(additional_arguments=[]) + Facter::Core::Execution.exec("/bin/ip #{additional_arguments.join(' ')}") + end + ## # exec_ifconfig uses the ifconfig command # # @return [String] the output of `ifconfig #{arguments} 2>/dev/null` or nil
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor