#NEWLINE# def query( self , request ) : #NEWLINE# #INDENT# with self . lock : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# messages = None #NEWLINE# self . _send ( request ) #NEWLINE# messages = self . _recv ( ) #NEWLINE# for message in messages : #NEWLINE# #INDENT# if isinstance ( message , ErrorMessage ) : #NEWLINE# #INDENT# raise RuntimeError ( str ( message ) ) #NEWLINE# #UNINDENT# #UNINDENT# return messages #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# if self . verbose : #NEWLINE# #INDENT# logging . error ( ( 'Netlink query failed: %s' % e ) ) #NEWLINE# logging . error ( ( 'Sent Request: %s' % request ) ) #NEWLINE# logging . error ( ( 'Recv Messages: %s' % messages ) ) #NEWLINE# #UNINDENT# raise