#NEWLINE# def _create_volume( driver_info , volume_size ) : #NEWLINE# #INDENT# 'Create volume in the SeaMicro storage pools designated for ironic.' #NEWLINE# ironic_pools = _get_pools ( driver_info , filters = { #NEWLINE# #INDENT# 'id' : 'ironic-' , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( ironic_pools is None ) : #NEWLINE# #INDENT# raise exception . VendorPassthruException ( _ ( 'No storage pools found for ironic' ) ) #NEWLINE# #UNINDENT# least_used_pool = sorted ( ironic_pools , key = ( lambda x : x . freeSize ) ) [ 0 ] #NEWLINE# return _get_client ( ** driver_info ) . volumes . create ( volume_size , least_used_pool )