#NEWLINE# def instance_fault_to_friendly_message( instance ) : #NEWLINE# #INDENT# fault = getattr ( instance , 'fault' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# message = fault . get ( 'message' , _ ( 'Unknown' ) ) #NEWLINE# default_message = ( _ ( 'Please try again later [Error: %s].' ) % instance ) #NEWLINE# fault_map = { #NEWLINE# #INDENT# 'NoValidHost' : _ ( 'There is not enough capacity for this flavor in the selected availability zone. Try again later or select a different availability zone.' ) , #NEWLINE# #UNINDENT# } #NEWLINE# return fault_map . get ( message , default_message )