Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Leen-Meyer:puppet
rubygem-facter
facter-ip-interface.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File facter-ip-interface.patch of Package rubygem-facter
diff -ru a/lib/facter/util/ip.rb b/lib/facter/util/ip.rb --- a/lib/facter/util/ip.rb 2023-06-13 09:33:59.799501020 +0200 +++ b/lib/facter/util/ip.rb 2023-06-13 09:33:59.827501808 +0200 @@ -80,7 +80,10 @@ 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"]) @@ -99,6 +102,13 @@ ## + # 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