#NEWLINE# def compareChecksum( fname , target , checksum ) : #NEWLINE# #INDENT# if os . path . exists ( fname ) : #NEWLINE# #INDENT# compare_string = '{0}:{1}' . format ( target , checksum ) #NEWLINE# with salt . utils . fopen ( fname , 'r' ) as f : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# current_line = f . readline ( ) #NEWLINE# if ( not current_line ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if current_line . endswith ( '\n' ) : #NEWLINE# #INDENT# current_line = current_line [ : ( - 1 ) ] #NEWLINE# #UNINDENT# if ( compare_string == current_line ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return False