Flip the assumption
If `Socket.ip_address_list` doesn't exist, then assume the dependency.
This commit is contained in:
parent
2fb9d23c01
commit
c4918b7295
@ -7,11 +7,9 @@ Puppet::Type.newtype(:resource_record) do
|
||||
autorequire(:service) do
|
||||
reqs = []
|
||||
# Depend on the bind service if the record is local
|
||||
if Socket.respond_to? :ip_address_list
|
||||
reqs << 'bind' if Socket.ip_address_list.any? do |intf|
|
||||
Resolv.getaddresses(self[:server]).any? do |addr|
|
||||
intf.ip_address === addr
|
||||
end
|
||||
reqs << 'bind' if !Socket.respond_to? :ip_address_list or Socket.ip_address_list.any? do |intf|
|
||||
Resolv.getaddresses(self[:server]).any? do |addr|
|
||||
intf.ip_address === addr
|
||||
end
|
||||
end
|
||||
reqs
|
||||
|
||||
Loading…
Reference in New Issue
Block a user