Module: Facter::Util::Resolvers::Networking::Dhcp

Defined in:
lib/facter/util/resolvers/networking/dhcp.rb

Overview

Since:

  • 2.0.0

Class Method Summary collapse

Class Method Details

.get(interface_name, log = nil) ⇒ Object

Since:

  • 2.0.0



9
10
11
12
13
14
15
# File 'lib/facter/util/resolvers/networking/dhcp.rb', line 9

def get(interface_name, log = nil)
  dhcpinfo_command = Facter::Core::Execution.which('dhcpinfo') || '/sbin/dhcpinfo'
  result = Facter::Core::Execution.execute("#{dhcpinfo_command} -i #{interface_name} ServerID", logger: log)
  result.chomp!

  result.empty? ? nil : result
end