'Validates that the setup supports using nested quotas.
Ensures that Keystone v3 or greater is being used, and that the
existing quotas make sense to nest in the current hierarchy (e.g. that
no child quota would be larger than it\'s parent).'

def validate_setup_for_nested_quota_use(self, req):

    ctxt = req.environ['cinder.context']
    params = req.params
    try:
        resources = QUOTAS.resources
        resources.update(GROUP_QUOTAS.resources)
        quota_utils.validate_setup_for_nested_quota_use(ctxt, resources, quota.NestedDbQuotaDriver(), fix_allocated_quotas=params.get('fix_allocated_quotas'))
    except exception.InvalidNestedQuotaSetup as e:
        raise webob.exc.HTTPBadRequest(explanation=e.msg)
