gluster_volume: Clarify error message to tell what actualy failed

This commit is contained in:
Otto Kekäläinen 2015-05-15 16:49:39 +03:00 committed by Greg DeKoenigsberg
parent 31c63b6755
commit 9cfe469751

View file

@ -247,11 +247,11 @@ def wait_for_peer(host):
time.sleep(1)
return False
def probe(host):
def probe(host, myhostname):
global module
run_gluster([ 'peer', 'probe', host ])
if not wait_for_peer(host):
module.fail_json(msg='failed to probe peer %s' % host)
module.fail_json(msg='failed to probe peer %s on %s' % (host, myhostname))
changed = True
def probe_all_peers(hosts, peers, myhostname):
@ -259,7 +259,7 @@ def probe_all_peers(hosts, peers, myhostname):
if host not in peers:
# dont probe ourselves
if myhostname != host:
probe(host)
probe(host, myhostname)
def create_volume(name, stripe, replica, transport, hosts, bricks, force):
args = [ 'volume', 'create' ]