#NEWLINE# def heartbeat( self , args ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# heartbeat = Heartbeat ( origin = args . origin , tags = args . tags , timeout = args . timeout ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# LOG . error ( e ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# response = self . api . send ( heartbeat ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# LOG . error ( e ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# if ( response [ 'status' ] == 'ok' ) : #NEWLINE# #INDENT# print ( response [ 'id' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# LOG . error ( response [ 'message' ] ) #NEWLINE# sys . exit ( 1 )