From ff7043cd658d3690a7a2a272cd7d6ca46c344abf Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 15 May 2013 16:20:41 +0100 Subject: Honour the global timeout period. The global configuration file, /etc/custodian/custodian.cfg, has a timeout=XX setting in it. Until now we've ignored it and used a fixed timeout of 20/30 seconds. Now we fully honour the specified value. --- lib/custodian/protocoltest/dns.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/custodian/protocoltest/dns.rb') diff --git a/lib/custodian/protocoltest/dns.rb b/lib/custodian/protocoltest/dns.rb index 4053747..daa0c4d 100644 --- a/lib/custodian/protocoltest/dns.rb +++ b/lib/custodian/protocoltest/dns.rb @@ -1,3 +1,4 @@ +require 'custodian/settings' require 'resolv' # @@ -93,10 +94,16 @@ module Custodian # Reset the result in case we've already run @error = nil + # + # Get the timeout period. + # + settings = Custodian::Settings.instance() + period = settings.timeout() + # # Do the lookup # - results = resolve_via( @host, @resolve_type, @resolve_name, 30 ) + results = resolve_via( @host, @resolve_type, @resolve_name, period ) return false if ( results.nil? ) # -- cgit v1.2.1