#NEWLINE# def __generate_response( self , status , msg , extra = None ) : #NEWLINE# #INDENT# '\n    Generate an infrastructure manager service response\n\n    Args:\n      status  A boolean value indicating the status\n      msg     A reason message (useful if this a failed operation)\n      extra   Any extra fields to be included in the response (Optional)\n\n    Returns:\n      A dictionary containing the operation response\n    ' #NEWLINE# utils . log ( 'Sending success = {0}, reason = {1}' . format ( response , msg ) ) #NEWLINE# response = { #NEWLINE# #INDENT# 'success' : status , #NEWLINE# 'reason' : msg , #NEWLINE# #UNINDENT# } #NEWLINE# if ( extra is not None ) : #NEWLINE# #INDENT# for ( key , value ) in extra . items ( ) : #NEWLINE# #INDENT# response [ key ] = value #NEWLINE# #UNINDENT# #UNINDENT# return response