Skip to content

Commit ae817ba

Browse files
author
BogdanIrimie
committed
(FACT-2736) Add log messages in networking resolver.
1 parent fe1fb4e commit ae817ba

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/facter/resolvers/networking_linux_resolver.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class << self
1111
private
1212

1313
def post_resolve(fact_name)
14+
log.debug('in networking_linux_resolver')
1415
@fact_list.fetch(fact_name) { retrieve_network_info(fact_name) }
1516

1617
@fact_list[fact_name]
@@ -36,12 +37,17 @@ def retrieve_interfaces_mac_and_mtu
3637
end
3738

3839
def retrieve_interface_info
40+
log.debug('retrieve_interface_info')
3941
output = Facter::Core::Execution.execute('ip -o address', logger: log)
42+
log.debug("ip -o address result is:\n#{output}")
43+
4044
interfaces = {}
4145

4246
output.each_line do |ip_line|
4347
ip_tokens = ip_line.split(' ')
4448

49+
log.debug("ip_tokens = #{ip_tokens}")
50+
log.debug("interfaces = #{interfaces}")
4551
fill_ip_v4_info!(ip_tokens, interfaces)
4652
fill_io_v6_info!(ip_tokens, interfaces)
4753
find_dhcp!(ip_tokens, interfaces)
@@ -93,10 +99,15 @@ def search_internal_leases(interface_name)
9399
end
94100

95101
def fill_ip_v4_info!(ip_tokens, network_info)
102+
log.debug('fill_ip_v4_info!')
96103
return unless ip_tokens[2].casecmp('inet').zero?
97104

98105
interface_name, ip4_address, ip4_mask_length = retrieve_name_and_ip_info(ip_tokens)
99106

107+
log.debug("interface_name = #{interface_name}")
108+
log.debug("ip4_address = #{ip4_address}")
109+
log.debug("ip4_mask_length = #{ip4_mask_length}")
110+
100111
binding = ::Resolvers::Utils::Networking.build_binding(ip4_address, ip4_mask_length)
101112
build_network_info_structure!(network_info, interface_name, :bindings)
102113

0 commit comments

Comments
 (0)