def percent(args=None):
 if (__grains__['kernel'] == 'Linux'):
  cmd = 'df -P'
 elif (__grains__['kernel'] == 'OpenBSD'):
  cmd = 'df -kP'
 else:
  cmd = 'df'
 ret = {}
 out = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
 for line in out:
  if (not line):
   continue
  if line.startswith('Filesystem'):
   continue
  comps = line.split()
  while (not comps[1].isdigit()):
   comps[0] = '{0} {1}'.format(comps[0], comps[1])
   comps.pop(1)
  try:
   if (__grains__['kernel'] == 'Darwin'):
    ret[comps[8]] = comps[4]
   else:
    ret[comps[5]] = comps[4]
  except IndexError:
   log.error('Problem parsing disk usage information')
   ret = {}
 if (args and (args not in ret)):
  log.error("Problem parsing disk usage information: Partition '{0}' does not exist!".format(args))
  ret = {}
 elif args:
  return ret[args]
 return ret

def percent ( args = None ) : if ( __grains__ [ 'kernel' ] == 'Linux' ) : cmd = 'df -P' elif ( __grains__ [ 'kernel' ] == 'OpenBSD' ) : cmd = 'df -kP' else : cmd = 'df' ret = { } out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) . splitlines ( ) for line in out : if ( not line ) : continue if line . startswith ( 'Filesystem' ) : continue comps = line . split ( ) while ( not comps [ 1 ] . isdigit ( ) ) : comps [ 0 ] = '{0} {1}' . format ( comps [ 0 ] , comps [ 1 ] ) comps . pop ( 1 ) try : if ( __grains__ [ 'kernel' ] == 'Darwin' ) : ret [ comps [ 8 ] ] = comps [ 4 ] else : ret [ comps [ 5 ] ] = comps [ 4 ] except IndexError : log . error ( 'Problem parsing disk usage information' ) ret = { } if ( args and ( args not in ret ) ) : log . error ( "Problem parsing disk usage information: Partition '{0}' does not exist!" . format ( args ) ) ret = { } elif args : return ret [ args ] return ret
return partition information for volumes mounted on this minion cli example: .