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