#NEWLINE# def check_sla( self , sla , diff_metric ) : #NEWLINE# #INDENT# '\n    Check whether the SLA has passed or failed\n    ' #NEWLINE# try : #NEWLINE# #INDENT# if ( diff_val . display is '%' ) : #NEWLINE# #INDENT# diff_val = float ( diff_metric [ 'percent_diff' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# diff_val = float ( diff_metric [ 'absolute_diff' ] ) #NEWLINE# #UNINDENT# #UNINDENT# except ValueError : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( not sla . check_sla_passed ( diff_val ) ) : #NEWLINE# #INDENT# self . sla_failures += 1 #NEWLINE# self . sla_failure_list . append ( DiffSLAFailure ( sla , diff_metric ) ) #NEWLINE# #UNINDENT# return True