Commit ea2a97c1 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added 'getStorageType()' method.

parent 013df8d5
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -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: