mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't require 'domain' to be present before checking fqdn_ip* grains
Fixes #34129
This commit is contained in:
parent
805171c949
commit
5f45a8ff73
1 changed files with 4 additions and 6 deletions
|
@ -1603,9 +1603,8 @@ def fqdn_ip4():
|
|||
addrs = []
|
||||
try:
|
||||
hostname_grains = hostname()
|
||||
if hostname_grains['domain']:
|
||||
info = socket.getaddrinfo(hostname_grains['fqdn'], None, socket.AF_INET)
|
||||
addrs = list(set(item[4][0] for item in info))
|
||||
info = socket.getaddrinfo(hostname_grains['fqdn'], None, socket.AF_INET)
|
||||
addrs = list(set(item[4][0] for item in info))
|
||||
except socket.error:
|
||||
pass
|
||||
return {'fqdn_ip4': addrs}
|
||||
|
@ -1633,9 +1632,8 @@ def fqdn_ip6():
|
|||
addrs = []
|
||||
try:
|
||||
hostname_grains = hostname()
|
||||
if hostname_grains['domain']:
|
||||
info = socket.getaddrinfo(hostname_grains['fqdn'], None, socket.AF_INET6)
|
||||
addrs = list(set(item[4][0] for item in info))
|
||||
info = socket.getaddrinfo(hostname_grains['fqdn'], None, socket.AF_INET6)
|
||||
addrs = list(set(item[4][0] for item in info))
|
||||
except socket.error:
|
||||
pass
|
||||
return {'fqdn_ip6': addrs}
|
||||
|
|
Loading…
Add table
Reference in a new issue