'Helper function that returns a list of flavor dicts.'

def _get_flavors(self, req):

    filters = {}
    sort_key = (req.params.get('sort_key') or 'flavorid')
    sort_dir = (req.params.get('sort_dir') or 'asc')
    (limit, marker) = common.get_limit_and_marker(req)
    context = req.environ['nova.context']
    if context.is_admin:
        filters['is_public'] = self._parse_is_public(req.params.get('is_public', None))
    else:
        filters['is_public'] = True
        filters['disabled'] = False
    if ('minRam' in req.params):
        try:
            filters['min_memory_mb'] = int(req.params['minRam'])
        except ValueError:
            msg = (_('Invalid    min_ram    filter    [%s]') % req.params['minRam'])
            raise webob.exc.HTTPBadRequest(explanation=msg)
    if ('minDisk' in req.params):
        try:
            filters['min_root_gb'] = int(req.params['minDisk'])
        except ValueError:
            msg = (_('Invalid    minDisk    filter    [%s]') % req.params['minDisk'])
            raise webob.exc.HTTPBadRequest(explanation=msg)
    try:
        limited_flavors = objects.FlavorList.get_all(context, filters=filters, sort_key=sort_key, sort_dir=sort_dir, limit=limit, marker=marker)
    except exception.MarkerNotFound:
        msg = (_('marker    [%s]    not    found') % marker)
        raise webob.exc.HTTPBadRequest(explanation=msg)
    return limited_flavors
