mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make 'module' global. Small whitespace formatting fixes. Closes Issue #397.
This commit is contained in:
parent
065b2fe309
commit
0243eec2a6
1 changed files with 7 additions and 2 deletions
|
@ -134,6 +134,7 @@ glusterbin = ''
|
||||||
|
|
||||||
def run_gluster(gargs, **kwargs):
|
def run_gluster(gargs, **kwargs):
|
||||||
global glusterbin
|
global glusterbin
|
||||||
|
global module
|
||||||
args = [glusterbin]
|
args = [glusterbin]
|
||||||
args.extend(gargs)
|
args.extend(gargs)
|
||||||
try:
|
try:
|
||||||
|
@ -146,6 +147,7 @@ def run_gluster(gargs, **kwargs):
|
||||||
|
|
||||||
def run_gluster_nofail(gargs, **kwargs):
|
def run_gluster_nofail(gargs, **kwargs):
|
||||||
global glusterbin
|
global glusterbin
|
||||||
|
global module
|
||||||
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)
|
||||||
|
@ -155,6 +157,7 @@ def run_gluster_nofail(gargs, **kwargs):
|
||||||
|
|
||||||
def run_gluster_yes(gargs):
|
def run_gluster_yes(gargs):
|
||||||
global glusterbin
|
global glusterbin
|
||||||
|
global module
|
||||||
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')
|
||||||
|
@ -240,6 +243,7 @@ def wait_for_peer(host):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def probe(host):
|
def probe(host):
|
||||||
|
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' % host)
|
||||||
|
@ -297,6 +301,7 @@ def set_quota(name, directory, value):
|
||||||
def main():
|
def main():
|
||||||
### MAIN ###
|
### MAIN ###
|
||||||
|
|
||||||
|
global module
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
name=dict(required=True, default=None, aliases=['volume']),
|
name=dict(required=True, default=None, aliases=['volume']),
|
||||||
|
|
Loading…
Reference in a new issue