def validate_setup_for_nested_quota_use(ctxt, resources, nested_quota_driver, fix_allocated_quotas=False):
 try:
  project_roots = get_all_root_project_ids(ctxt)
  for root in project_roots:
   root_proj = get_project_hierarchy(ctxt, root, subtree_as_ids=True)
   nested_quota_driver.validate_nested_setup(ctxt, resources, {root_proj.id: root_proj.subtree}, fix_allocated_quotas=fix_allocated_quotas)
 except exceptions.VersionNotAvailable:
  msg = _('Keystone version 3 or greater must be used to get nested quota support.')
  raise exception.CinderException(message=msg)
 except exceptions.Forbidden:
  msg = _('Must run this command as cloud admin using a Keystone policy.json which allows cloud admin to list and get any project.')
  raise exception.CinderException(message=msg)

def validate_setup_for_nested_quota_use ( ctxt , resources , nested_quota_driver , fix_allocated_quotas = False ) : try : project_roots = get_all_root_project_ids ( ctxt ) for root in project_roots : root_proj = get_project_hierarchy ( ctxt , root , subtree_as_ids = True ) nested_quota_driver . validate_nested_setup ( ctxt , resources , { root_proj . id : root_proj . subtree } , fix_allocated_quotas = fix_allocated_quotas ) except exceptions . VersionNotAvailable : msg = _ ( 'Keystone version 3 or greater must be used to get nested quota support.' ) raise exception . CinderException ( message = msg ) except exceptions . Forbidden : msg = _ ( 'Must run this command as cloud admin using a Keystone policy.json which allows cloud admin to list and get any project.' ) raise exception . CinderException ( message = msg )
validates the setup supports using nested quotas .