Enables retrieval of project's parents and subtree
Adds the possibility to retrieve a project and list its parents and subtree in the hierarchy. Co-Authored-By: Rodrigo Duarte <rodrigods@lsd.ufcg.edu.br> Co-Authored-By: Samuel de Medeiros Queiroz <samuel@lsd.ufcg.edu.br> Implements: bp hierarchical-multitenancy Change-Id: I874f6faffc8a2db9d99f12cbe0a69c0a30c0d9df
This commit is contained in:
@@ -51,7 +51,7 @@ def find_resource(manager, name_or_id, **kwargs):
|
|||||||
# Try to get entity as integer id
|
# Try to get entity as integer id
|
||||||
try:
|
try:
|
||||||
if isinstance(name_or_id, int) or name_or_id.isdigit():
|
if isinstance(name_or_id, int) or name_or_id.isdigit():
|
||||||
return manager.get(int(name_or_id))
|
return manager.get(int(name_or_id), **kwargs)
|
||||||
# FIXME(dtroyer): The exception to catch here is dependent on which
|
# FIXME(dtroyer): The exception to catch here is dependent on which
|
||||||
# client library the manager passed in belongs to.
|
# client library the manager passed in belongs to.
|
||||||
# Eventually this should be pulled from a common set
|
# Eventually this should be pulled from a common set
|
||||||
@@ -64,7 +64,7 @@ def find_resource(manager, name_or_id, **kwargs):
|
|||||||
|
|
||||||
# Try directly using the passed value
|
# Try directly using the passed value
|
||||||
try:
|
try:
|
||||||
return manager.get(name_or_id)
|
return manager.get(name_or_id, **kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user