#NEWLINE# def _get_external_accounts( self , locals ) : #NEWLINE# #INDENT# '\n        Return all known accounts, excluding local accounts.\n        ' #NEWLINE# users = dict ( ) #NEWLINE# out = __salt__ [ 'cmd.run_all' ] ( 'passwd -S -a' ) #NEWLINE# if out [ 'retcode' ] : #NEWLINE# #INDENT# return users #NEWLINE# #UNINDENT# status = { #NEWLINE# #INDENT# 'L' : 'Locked' , #NEWLINE# 'NP' : 'No password' , #NEWLINE# 'P' : 'Usable password' , #NEWLINE# 'LK' : 'Locked' , #NEWLINE# #UNINDENT# } #NEWLINE# for data in [ elm . strip ( ) . split ( ' ' ) for elm in out [ 'stdout' ] . split ( os . linesep ) if elm . strip ( ) ] : #NEWLINE# #INDENT# if ( len ( data ) < 2 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( name , login ) = data [ : 2 ] #NEWLINE# if ( name not in locals ) : #NEWLINE# #INDENT# users [ name ] = { #NEWLINE# #INDENT# 'login' : login , #NEWLINE# 'status' : status . get ( login , 'N/A' ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# return users