Skip to content

Commit

Permalink
Fix localhost detection in glusterfs.peers
Browse files Browse the repository at this point in the history
  • Loading branch information
rmsc committed Jul 5, 2022
1 parent c7d0a80 commit 3130523
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion salt/states/glusterfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def peered(name):
# it from the user.
this_ips = set(salt.utils.network.ip_addrs())
this_ips.update(salt.utils.network.ip_addrs6())
if this_ips.intersection(name_ips):
if (any(salt.utils.network.is_loopback(addr) for addr in name_ips)
or this_ips.intersection(name_ips)):
ret["result"] = True
ret["comment"] = "Peering with localhost is not needed"
return ret
Expand Down

0 comments on commit 3130523

Please sign in to comment.