def shells():
 shells_fn = '/etc/shells'
 ret = []
 if os.path.exists(shells_fn):
  try:
   with salt.utils.fopen(shells_fn, 'r') as shell_fp:
    lines = shell_fp.read().splitlines()
   for line in lines:
    line = line.strip()
    if line.startswith('#'):
     continue
    elif (not line):
     continue
    else:
     ret.append(line)
  except OSError:
   log.error("File '{0}' was not found".format(shells_fn))
 return ret

def shells ( ) : shells_fn = '/etc/shells' ret = [ ] if os . path . exists ( shells_fn ) : try : with salt . utils . fopen ( shells_fn , 'r' ) as shell_fp : lines = shell_fp . read ( ) . splitlines ( ) for line in lines : line = line . strip ( ) if line . startswith ( '#' ) : continue elif ( not line ) : continue else : ret . append ( line ) except OSError : log . error ( "File '{0}' was not found" . format ( shells_fn ) ) return ret
lists the valid shells on this system via the /etc/shells file .