#NEWLINE# def name_match( self , match , full = False ) : #NEWLINE# #INDENT# "\n        Accept a glob which to match the of a key and return the key's location\n        " #NEWLINE# if full : #NEWLINE# #INDENT# matches = self . all_keys ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# matches = self . list_keys ( ) #NEWLINE# #UNINDENT# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( ( ',' in match ) and isinstance ( match , str ) ) : #NEWLINE# #INDENT# match = match . split ( ',' ) #NEWLINE# #UNINDENT# for ( status , keys ) in six . iteritems ( matches ) : #NEWLINE# #INDENT# for key in salt . utils . isorted ( keys ) : #NEWLINE# #INDENT# if isinstance ( match , list ) : #NEWLINE# #INDENT# for match_item in match : #NEWLINE# #INDENT# if fnmatch . fnmatch ( key , match_item ) : #NEWLINE# #INDENT# if ( status not in ret ) : #NEWLINE# #INDENT# ret [ status ] = [ ] #NEWLINE# #UNINDENT# ret [ status ] . append ( key ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if fnmatch . fnmatch ( key , full ) : #NEWLINE# #INDENT# if ( status not in ret ) : #NEWLINE# #INDENT# ret [ status ] = [ ] #NEWLINE# #UNINDENT# ret [ status ] . append ( key ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return ret