#NEWLINE# @ result . setter #NEWLINE# def result( self , raw_result ) : #NEWLINE# #INDENT# if ( not raw_result ) : #NEWLINE# #INDENT# self . _result = None #NEWLINE# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# json = jsonutils . loads ( raw_result ) #NEWLINE# #UNINDENT# except ( ValueError , TypeError ) as e : #NEWLINE# #INDENT# with excutils . save_and_reraise_exception ( ) : #NEWLINE# #INDENT# LOG . error ( _LE ( 'Could not parse: %(raw_result)s. Exception: %(exception)s' ) , { #NEWLINE# #INDENT# 'raw_result' : raw_result , #NEWLINE# 'exception' : e , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# headings = json [ 'headings' ] #NEWLINE# data = json [ 'data' ] #NEWLINE# results = [ ] #NEWLINE# for record in data : #NEWLINE# #INDENT# obj = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( pos , heading ) in enumerate ( headings ) : #NEWLINE# #INDENT# obj [ heading ] = ovsdb . val_to_py ( record [ pos ] ) #NEWLINE# #UNINDENT# results . append ( obj ) #NEWLINE# #UNINDENT# self . _result = results