Class: Facter::Resolvers::Openbsd::Dhcp

Inherits:
Networking show all
Defined in:
lib/facter/resolvers/openbsd/dhcp.rb

Class Method Summary collapse

Methods inherited from BaseResolver

cache_nil_for_unresolved_facts, init_resolver, invalidate_cache, post_resolve, resolve, subscribe_to_manager

Class Method Details

.extract_dhcp(interface_name, raw_data, parsed_interface_data) ⇒ Object



11
12
13
14
15
16
# File 'lib/facter/resolvers/openbsd/dhcp.rb', line 11

def extract_dhcp(interface_name, raw_data, parsed_interface_data)
  return unless raw_data.match?(/status:\s+active/)

  result = Facter::Core::Execution.execute("dhcpleasectl -l #{interface_name}", logger: log)
  parsed_interface_data[:dhcp] = extract_values(result, /\sdhcp server (\S+)/).first unless result.empty?
end