#NEWLINE# def _format_response( response , msg ) : #NEWLINE# #INDENT# error = 'RabbitMQ command failed: {0}' . format ( response ) #NEWLINE# if isinstance ( response , dict ) : #NEWLINE# #INDENT# if ( response [ 'retcode' ] != 0 ) : #NEWLINE# #INDENT# raise CommandExecutionError ( error ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# msg = response [ 'stdout' ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'Error' in response ) : #NEWLINE# #INDENT# raise CommandExecutionError ( error ) #NEWLINE# #UNINDENT# #UNINDENT# return { #NEWLINE# #INDENT# msg : response , #NEWLINE# #UNINDENT# }