Skip to content
Snippets Groups Projects
Commit 71efae42 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added 'getCreatorId()' method for VOSpace nodes.

parent 7ddb87ae
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,25 @@ class DbConnector(object):
else:
return False
def getCreatorId(self, vospacePath):
"""Returns the creator ID for a given vospace path representing a node."""
with self.getConnection() as conn:
try:
cursor = conn.cursor(cursor_factory = RealDictCursor)
cursor.execute("""
SELECT creator_id
FROM node_vos_path nvp
JOIN node n ON nvp.node_id = n.node_id
WHERE vos_path = %s;
""",
(vospacePath,))
result = cursor.fetchall()
except Exception as e:
if not conn.closed:
conn.rollback()
print(e)
return result[0]["creator_id"]
def getOSPath(self, vospacePath):
"""Returns a list containing full path, storage type and username for a VOSpace path."""
with self.getConnection() as conn:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment