mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
require large timediff for ipv6 warning
This commit is contained in:
parent
4780d7830a
commit
1435bf177e
1 changed files with 5 additions and 3 deletions
|
@ -1688,12 +1688,14 @@ def ip_fqdn():
|
|||
ret[key] = []
|
||||
else:
|
||||
try:
|
||||
start_time = datetime.datetime.utcnow()
|
||||
info = socket.getaddrinfo(_fqdn, None, socket_type)
|
||||
ret[key] = list(set(item[4][0] for item in info))
|
||||
except socket.error:
|
||||
if __opts__['__role'] == 'master':
|
||||
log.warning('Unable to find IPv{0} record for "{1}" causing a 10 second timeout when rendering grains. '
|
||||
'Set the dns or /etc/hosts for IPv{0} to clear this.'.format(ipv_num, _fqdn))
|
||||
timediff = datetime.datetime.utcnow() - start_time
|
||||
if timediff.seconds > 5 and __opts__['__role'] == 'master':
|
||||
log.warning('Unable to find IPv{0} record for "{1}" causing a {2} second timeout when rendering grains. '
|
||||
'Set the dns or /etc/hosts for IPv{0} to clear this.'.format(ipv_num, _fqdn, timediff))
|
||||
ret[key] = []
|
||||
|
||||
return ret
|
||||
|
|
Loading…
Add table
Reference in a new issue