#NEWLINE# def _CheckApprovalsForTokenWithoutReason( self , token , target ) : #NEWLINE# #INDENT# approval_root_urn = aff4 . ROOT_URN . Add ( 'ACL' ) . Add ( target . Path ( ) ) . Add ( token . username ) #NEWLINE# try : #NEWLINE# #INDENT# cached_token = self . acl_cache . Get ( approval_root_urn ) #NEWLINE# stats . STATS . IncrementCounter ( 'approval_searches' , fields = [ 'without_reason' , 'cache' ] ) #NEWLINE# token . is_emergency = cached_token . is_emergency #NEWLINE# token . reason = cached_token . reason #NEWLINE# return True #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# stats . STATS . IncrementCounter ( 'approval_searches' , fields = [ 'without_reason' , 'data_store' ] ) #NEWLINE# approved_token = aff4 . Approval . GetApprovalForObject ( target , token = token ) #NEWLINE# token . reason = approved_token . reason #NEWLINE# token . is_emergency = approved_token . is_emergency #NEWLINE# self . acl_cache . Put ( approval_root_urn , approved_token ) #NEWLINE# return True