File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
util/resolvers/networking Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def read_facts(fact_name)
2727 @fact_list [ :primary_interface ] = Facter ::Util ::Resolvers ::Networking ::PrimaryInterface . read_from_route
2828
2929 unless @interfaces . empty?
30- @fact_list = { interfaces : @interfaces }
30+ @fact_list [ :interfaces ] = @interfaces
3131 @fact_list [ :primary_interface ] ||=
3232 Facter ::Util ::Resolvers ::Networking ::PrimaryInterface . find_in_interfaces ( @interfaces )
3333 end
@@ -45,7 +45,9 @@ def obtain_info_for_interface(lifreq)
4545 add_mac ( lifreq )
4646 add_bindings ( lifreq )
4747 add_mtu ( lifreq )
48- @interfaces [ lifreq . name ] [ :dhcp ] = Facter ::Util ::Resolvers ::Networking ::Dhcp . get ( lifreq . name , @log )
48+
49+ dhcp = Facter ::Util ::Resolvers ::Networking ::Dhcp . get ( lifreq . name , @log )
50+ @interfaces [ lifreq . name ] [ :dhcp ] = dhcp if dhcp
4951 end
5052
5153 def add_mac ( lifreq )
Original file line number Diff line number Diff line change @@ -9,8 +9,9 @@ class << self
99 def get ( interface_name , log = nil )
1010 dhcpinfo_command = Facter ::Core ::Execution . which ( 'dhcpinfo' ) || '/sbin/dhcpinfo'
1111 result = Facter ::Core ::Execution . execute ( "#{ dhcpinfo_command } -i #{ interface_name } ServerID" , logger : log )
12+ result . chomp!
1213
13- result . chomp
14+ result . empty? ? nil : result
1415 end
1516 end
1617 end
You can’t perform that action at this time.
0 commit comments