Flip the assumption

If `Socket.ip_address_list` doesn't exist, then assume the dependency.
This commit is contained in:
Nate Riffe 2015-12-30 21:05:56 -06:00
parent 2fb9d23c01
commit c4918b7295

View File

@ -7,11 +7,9 @@ Puppet::Type.newtype(:resource_record) do
autorequire(:service) do autorequire(:service) do
reqs = [] reqs = []
# Depend on the bind service if the record is local # Depend on the bind service if the record is local
if Socket.respond_to? :ip_address_list reqs << 'bind' if !Socket.respond_to? :ip_address_list or Socket.ip_address_list.any? do |intf|
reqs << 'bind' if Socket.ip_address_list.any? do |intf| Resolv.getaddresses(self[:server]).any? do |addr|
Resolv.getaddresses(self[:server]).any? do |addr| intf.ip_address === addr
intf.ip_address === addr
end
end end
end end
reqs reqs