1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

gluster_volume: Fixes gluster peer probe / volume creation issue. (#3486)

* gluster_volume: Fixes issue when creating a new volume failing due to peers not being present. The peers which are not 'localhost' should invoke wait_for_peer, but the find method returns -1 (not 0) on non-localhost peers.
This commit is contained in:
Matthew Krupcale 2016-11-17 13:15:11 -05:00 committed by Matt Clay
parent c8a700834c
commit cb765ce590

View file

@ -274,7 +274,7 @@ def wait_for_peer(host):
def probe(host, myhostname):
global module
out = run_gluster([ 'peer', 'probe', host ])
if not out.find('localhost') and not wait_for_peer(host):
if out.find('localhost') == -1 and not wait_for_peer(host):
module.fail_json(msg='failed to probe peer %s on %s' % (host, myhostname))
changed = True