#NEWLINE# @ extensions . expected_errors ( ( 404 , 501 ) ) #NEWLINE# @ common . check_cells_enabled #NEWLINE# def capacities( self , req , id = None ) : #NEWLINE# #INDENT# 'Return capacities for a given cell or all cells.' #NEWLINE# context = req . environ [ 'nova.context' ] #NEWLINE# authorize ( context ) #NEWLINE# try : #NEWLINE# #INDENT# capacities = self . cells_rpcapi . get_capacities ( context , cell_name = id ) #NEWLINE# #UNINDENT# except exception . CellNotFound as e : #NEWLINE# #INDENT# raise exc . HTTPNotFound ( explanation = e . format_message ( ) ) #NEWLINE# #UNINDENT# return dict ( cell = { #NEWLINE# #INDENT# 'capacities' : capacities , #NEWLINE# #UNINDENT# } )