]> git.openstreetmap.org Git - chef.git/commitdiff
Coerce addresses to strings
authorTom Hughes <tom@compton.nu>
Sat, 18 Mar 2023 11:43:55 +0000 (11:43 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 18 Mar 2023 11:43:55 +0000 (11:43 +0000)
cookbooks/networking/resources/firewall_rule.rb

index 7d7d45b7ab9b9dab044877cb3b6e9f9d19afc40e..22bde6ca99d61cec37ba5700df9af5eb722a9c87 100644 (file)
@@ -118,9 +118,9 @@ action_class do
       addresses
     else
       Array(addresses).map do |address|
-        if ip == "ip" && IPAddr.new(address).ipv4?
+        if ip == "ip" && IPAddr.new(address.to_s).ipv4?
           address
-        elsif ip == "ip6" && IPAddr.new(address).ipv6?
+        elsif ip == "ip6" && IPAddr.new(address.to_s).ipv6?
           address
         end
       end.compact