Commit 3127bab6 by Stephen Fromm

Use get_bin_path to find mkfs command (issue #2983)

parent 0c03a5cf
...@@ -88,11 +88,12 @@ def main(): ...@@ -88,11 +88,12 @@ def main():
if module.check_mode: if module.check_mode:
changed = True changed = True
else: else:
mkfs = module.get_bin_path('mkfs', required=True)
cmd = None cmd = None
if opts is None: if opts is None:
cmd = "mkfs -t %s '%s'"%(fstype, dev) cmd = "%s -t %s '%s'" % (mkfs, fstype, dev)
else: else:
cmd = "mkfs -t %s %s '%s'"%(fstype, opts, dev) cmd = "%s -t %s %s '%s'" % (mkfs, fstype, opts, dev)
rc,_,err = module.run_command(cmd) rc,_,err = module.run_command(cmd)
if rc == 0: if rc == 0:
changed = True changed = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment