def get_project_hierarchy(context, project_id, subtree_as_ids=False, parents_as_ids=False, is_admin_project=False):
 keystone = _keystone_client(context)
 generic_project = GenericProjectInfo(project_id, keystone.version)
 if (keystone.version == 'v3'):
  project = keystone.projects.get(project_id, subtree_as_ids=subtree_as_ids, parents_as_ids=parents_as_ids)
  generic_project.parent_id = None
  if (project.parent_id != project.domain_id):
   generic_project.parent_id = project.parent_id
  generic_project.subtree = (project.subtree if subtree_as_ids else None)
  generic_project.parents = None
  if parents_as_ids:
   generic_project.parents = _filter_domain_id_from_parents(project.domain_id, project.parents)
  generic_project.is_admin_project = is_admin_project
 return generic_project

def get_project_hierarchy ( context , project_id , subtree_as_ids = False , parents_as_ids = False , is_admin_project = False ) : keystone = _keystone_client ( context ) generic_project = GenericProjectInfo ( project_id , keystone . version ) if ( keystone . version == 'v3' ) : project = keystone . projects . get ( project_id , subtree_as_ids = subtree_as_ids , parents_as_ids = parents_as_ids ) generic_project . parent_id = None if ( project . parent_id != project . domain_id ) : generic_project . parent_id = project . parent_id generic_project . subtree = ( project . subtree if subtree_as_ids else None ) generic_project . parents = None if parents_as_ids : generic_project . parents = _filter_domain_id_from_parents ( project . domain_id , project . parents ) generic_project . is_admin_project = is_admin_project return generic_project
a helper method to get the project hierarchy .