#NEWLINE# def status( status , message , force_print = False ) : #NEWLINE# #INDENT# global STATUS #NEWLINE# if ( status in ( 'ok' , 'warn' , 'err' ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'The status "%s" is not allowed because it creates a metric called legacy_state' % status ) ) #NEWLINE# #UNINDENT# status_line = ( 'status %s' % status ) #NEWLINE# if ( message is not None ) : #NEWLINE# #INDENT# status_line = ' ' . join ( ( status_line , str ( message ) ) ) #NEWLINE# #UNINDENT# status_line = status_line . replace ( '\n' , '\\n' ) #NEWLINE# STATUS = status_line #NEWLINE# if force_print : #NEWLINE# #INDENT# print ( STATUS )