glusterbin needs to be global

This commit is contained in:
Brian Coca 2015-03-31 14:29:38 -04:00
parent 6168677a83
commit f901fd0160

View file

@ -130,8 +130,10 @@ import shutil
import time import time
import socket import socket
glusterbin = ''
def run_gluster(gargs, **kwargs): def run_gluster(gargs, **kwargs):
global glusterbin
args = [glusterbin] args = [glusterbin]
args.extend(gargs) args.extend(gargs)
try: try:
@ -143,6 +145,7 @@ def run_gluster(gargs, **kwargs):
return out return out
def run_gluster_nofail(gargs, **kwargs): def run_gluster_nofail(gargs, **kwargs):
global glusterbin
args = [glusterbin] args = [glusterbin]
args.extend(gargs) args.extend(gargs)
rc, out, err = module.run_command(args, **kwargs) rc, out, err = module.run_command(args, **kwargs)
@ -151,6 +154,7 @@ def run_gluster_nofail(gargs, **kwargs):
return out return out
def run_gluster_yes(gargs): def run_gluster_yes(gargs):
global glusterbin
args = [glusterbin] args = [glusterbin]
args.extend(gargs) args.extend(gargs)
rc, out, err = module.run_command(args, data='y\n') rc, out, err = module.run_command(args, data='y\n')
@ -312,6 +316,7 @@ def main():
) )
) )
global glusterbin
glusterbin = module.get_bin_path('gluster', True) glusterbin = module.get_bin_path('gluster', True)
changed = False changed = False