Merge pull request #13428 from scentoni/fix-solaris-mount

Added mount.active functionality for Solaris.
This commit is contained in:
Thomas S Hatch 2014-06-12 16:47:35 -06:00
commit 7ba7a21868

View File

@ -103,6 +103,18 @@ def _active_mounts_freebsd(ret):
return ret
def _active_mounts_solaris(ret):
'''
List active mounts on Solaris systems
'''
for line in __salt__['cmd.run_stdout']('mount -v').split('\n'):
comps = re.sub(r"\s+", " ", line).split()
ret[comps[2]] = {'device': comps[0],
'fstype': comps[4],
'opts': comps[5].split(',')}
return ret
def active():
'''
List the active mounts.
@ -116,6 +128,8 @@ def active():
ret = {}
if __grains__['os'] == 'FreeBSD':
_active_mounts_freebsd(ret)
elif __grains__['os'] == 'Solaris':
_active_mounts_solaris(ret)
else:
try:
_active_mountinfo(ret)