#NEWLINE# def check( self , ip , port = None ) : #NEWLINE# #INDENT# '\n        ' #NEWLINE# try : #NEWLINE# #INDENT# rport = ( self . port if ( port is None ) else port ) #NEWLINE# request = utility . requests_get ( 'http://{0}:{1}{2}' . format ( ip , rport , self . uri ) ) #NEWLINE# compare_hash = md5 ( request . content [ : 44 ] ) . hexdigest ( ) #NEWLINE# if ( compare_hash == self . hash ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# except exceptions . Timeout : #NEWLINE# #INDENT# utility . Msg ( '{0} timeout to {1}:{2}' . format ( self . platform , ip , rport ) , LOG . DEBUG ) #NEWLINE# #UNINDENT# except exceptions . ConnectionError : #NEWLINE# #INDENT# utility . Msg ( '{0} connection error to {1}:{2}' . format ( self . platform , ip , rport ) , LOG . DEBUG ) #NEWLINE# #UNINDENT# return False