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
|
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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user