Loading transfer_service/db_connector.py +11 −1 Original line number Diff line number Diff line Loading @@ -177,6 +177,16 @@ class DbConnector(object): self.cursor.execute("SELECT * FROM storage WHERE storage_type = %s;", (storageType,)) return self.cursor.fetchall() def getStorageType(self, basePath): """Returns the storage type for a given storage base path, if any. Otherwise it returns 'False'.""" if self.conn: self.cursor.execute("SELECT storage_type FROM storage WHERE base_path = %s;", (basePath,)) result = self.cursor.fetchall() if result: return result[0]["storage_type"] else: return False def getStorageId(self, basePath): """Returns the storage id for a given storage base path, if any. Otherwise it returns 'False'.""" if self.conn: Loading Loading
transfer_service/db_connector.py +11 −1 Original line number Diff line number Diff line Loading @@ -177,6 +177,16 @@ class DbConnector(object): self.cursor.execute("SELECT * FROM storage WHERE storage_type = %s;", (storageType,)) return self.cursor.fetchall() def getStorageType(self, basePath): """Returns the storage type for a given storage base path, if any. Otherwise it returns 'False'.""" if self.conn: self.cursor.execute("SELECT storage_type FROM storage WHERE base_path = %s;", (basePath,)) result = self.cursor.fetchall() if result: return result[0]["storage_type"] else: return False def getStorageId(self, basePath): """Returns the storage id for a given storage base path, if any. Otherwise it returns 'False'.""" if self.conn: Loading