mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
pylint E741 triggers error in salt-pylint E8741 (unhandled)
This commit is contained in:
parent
2052838a4d
commit
9d72f13cac
1 changed files with 4 additions and 4 deletions
|
@ -236,8 +236,8 @@ def get_fqhostname():
|
|||
"""
|
||||
Returns the fully qualified hostname
|
||||
"""
|
||||
l = []
|
||||
l.append(socket.getfqdn())
|
||||
fqdn = []
|
||||
fqdn.append(socket.getfqdn())
|
||||
|
||||
# try socket.getaddrinfo
|
||||
try:
|
||||
|
@ -247,11 +247,11 @@ def get_fqhostname():
|
|||
for info in addrinfo:
|
||||
# info struct [family, socktype, proto, canonname, sockaddr]
|
||||
if len(info) >= 4:
|
||||
l.append(info[3])
|
||||
fqdn.append(info[3])
|
||||
except socket.gaierror:
|
||||
pass
|
||||
|
||||
return l and l[0] or None
|
||||
return fqdn and fqdn[0] or None
|
||||
|
||||
|
||||
def ip_to_host(ip):
|
||||
|
|
Loading…
Add table
Reference in a new issue