#NEWLINE# @ wsgi . response ( 202 ) #NEWLINE# @ wsgi . action ( 'resize' ) #NEWLINE# def _action_resize( self , req , id , body ) : #NEWLINE# #INDENT# 'Resizes a given instance to the flavor size requested.' #NEWLINE# try : #NEWLINE# #INDENT# flavor_ref = str ( body [ 'resize' ] [ 'flavorRef' ] ) #NEWLINE# if ( not flavor_ref ) : #NEWLINE# #INDENT# msg = _ ( "Resize request has invalid 'flavorRef' attribute." ) #NEWLINE# raise exc . HTTPBadRequest ( explanation = msg ) #NEWLINE# #UNINDENT# #UNINDENT# except ( KeyError , TypeError ) : #NEWLINE# #INDENT# msg = _ ( "Resize requests require 'flavorRef' attribute." ) #NEWLINE# raise exc . HTTPBadRequest ( explanation = msg ) #NEWLINE# #UNINDENT# kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( 'auto_disk_config' in body [ 'resize' ] ) : #NEWLINE# #INDENT# kwargs [ 'auto_disk_config' ] = body [ 'resize' ] [ 'auto_disk_config' ] #NEWLINE# #UNINDENT# return self . _resize ( req , id , flavor_ref , ** kwargs )