Loading transfer_service/db_connector.py +19 −0 Original line number Diff line number Diff line Loading @@ -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: Loading Loading
transfer_service/db_connector.py +19 −0 Original line number Diff line number Diff line Loading @@ -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: Loading