mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #15969 from garethgreenaway/15948_2017_7_fixes_to_parted
Fixes to parted.py module
This commit is contained in:
commit
4f3a2489cc
@ -53,6 +53,8 @@ def __virtual__():
|
||||
return False
|
||||
if not salt.utils.which('lsblk'):
|
||||
return False
|
||||
if not salt.utils.which('partprobe'):
|
||||
return False
|
||||
return __virtualname__
|
||||
|
||||
|
||||
@ -377,7 +379,10 @@ def mkfs(device, fs_type):
|
||||
'hfs', 'hfs+', 'hfsx', 'NTFS', 'ufs']):
|
||||
raise CommandExecutionError('Invalid fs_type passed to partition.mkfs')
|
||||
|
||||
cmd = 'mkfs.{0} {1}'.format(fs_type, device)
|
||||
mkfs_cmd = 'mkfs.{0}'.format(fs_type)
|
||||
if not salt.utils.which(mkfs_cmd):
|
||||
return 'Error: {0} is unavailable.'
|
||||
cmd = '{0} {1}'.format(mkfs_cmd, device)
|
||||
out = __salt__['cmd.run'](cmd).splitlines()
|
||||
return out
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user