Skip to content

Commit 2491788

Browse files
committed
(FACT-3154) Updates socket parser error handling
Prior to this commit, the `mac_from` method would implicitly return a logging object when rescuing an error when it should return nil. This commit updates the method to correctly return nil when rescuing an error, which fixes some failing tests in Ruby >= 3.2.0.
1 parent 3357ca5 commit 2491788

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/facter/util/linux/socket_parser.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def mac_from(ifaddr)
8888
end
8989
rescue StandardError => e
9090
@log.debug("Could not read mac for interface #{ifaddr.name}, got #{e}")
91+
nil
9192
end
9293

9394
def mac_from_sockaddr_of(ifaddr)

0 commit comments

Comments
 (0)