def get_mode(device):
 ret = {}
 cmd = 'quotaon -p {0}'.format(device)
 out = __salt__['cmd.run'](cmd, python_shell=False)
 for line in out.splitlines():
  comps = line.strip().split()
  if (comps[3] not in ret):
   if comps[0].startswith('quotaon'):
    if comps[1].startswith('Mountpoint'):
     ret[comps[4]] = 'disabled'
     continue
    elif comps[1].startswith('Cannot'):
     ret[device] = 'Not found'
     return ret
    continue
   ret[comps[3]] = {'device': comps[4].replace('(', '').replace(')', '')}
  ret[comps[3]][comps[0]] = comps[6]
 return ret

def get_mode ( device ) : ret = { } cmd = 'quotaon -p {0}' . format ( device ) out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) for line in out . splitlines ( ) : comps = line . strip ( ) . split ( ) if ( comps [ 3 ] not in ret ) : if comps [ 0 ] . startswith ( 'quotaon' ) : if comps [ 1 ] . startswith ( 'Mountpoint' ) : ret [ comps [ 4 ] ] = 'disabled' continue elif comps [ 1 ] . startswith ( 'Cannot' ) : ret [ device ] = 'Not found' return ret continue ret [ comps [ 3 ] ] = { 'device' : comps [ 4 ] . replace ( '(' , '' ) . replace ( ')' , '' ) } ret [ comps [ 3 ] ] [ comps [ 0 ] ] = comps [ 6 ] return ret
return the mode of a file path file or directory of which to get the mode follow_symlinks indicated if symlinks should be followed cli example: .