mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #3065 from sfromm/issue2983
Use get_bin_path to find mkfs command (issue #2983)
This commit is contained in:
commit
77ffef5379
1 changed files with 3 additions and 2 deletions
|
@ -88,11 +88,12 @@ def main():
|
|||
if module.check_mode:
|
||||
changed = True
|
||||
else:
|
||||
mkfs = module.get_bin_path('mkfs', required=True)
|
||||
cmd = None
|
||||
if opts is None:
|
||||
cmd = "mkfs -t %s '%s'"%(fstype, dev)
|
||||
cmd = "%s -t %s '%s'" % (mkfs, fstype, dev)
|
||||
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)
|
||||
if rc == 0:
|
||||
changed = True
|
||||
|
|
Loading…
Reference in a new issue