Example #1
0
    def connect(self, domType, conList):
        """
        Connect to a storage low level entity (server).
        """
        self.log.info("Request to connect %s storage server", sd.type2name(domType))
        conParams = self.__validateConnectionParams(domType, conList)

        if domType == sd.NFS_DOMAIN:
            return self.__connectFileServer(conParams, fileUtils.FSTYPE_NFS)
        elif domType == sd.LOCALFS_DOMAIN:
            return self.__connectLocalConnection(conParams)
        elif domType in sd.BLOCK_DOMAIN_TYPES:
            return self.__connectiSCSIServer(conParams)
        else:
            raise se.InvalidParameterException("type", domType)
Example #2
0
    def validate(self, domType, conList):
        """
        Validate that we can connect to a storage server.
        """
        self.log.info("Request to validate %s storage server", sd.type2name(domType))
        conParams = self.__validateConnectionParams(domType, conList)

        if domType == sd.NFS_DOMAIN:
            return self.__validateFileServer(conParams, fileUtils.FSTYPE_NFS)
        elif domType == sd.LOCALFS_DOMAIN:
            return self.__validateLocalConnection(conParams)
        elif domType in sd.BLOCK_DOMAIN_TYPES:
            return self.__validateiSCSIConnection(conParams)
        else:
            raise se.InvalidParameterException("type", domType)
Example #3
0
    def connect(self, domType, conList):
        """
        Connect to a storage low level entity (server).
        """
        self.log.info("Request to connect %s storage server",
                      sd.type2name(domType))
        conParams = self.__validateConnectionParams(domType, conList)

        if domType == sd.NFS_DOMAIN:
            return self.__connectFileServer(conParams, fileUtils.FSTYPE_NFS)
        elif domType == sd.LOCALFS_DOMAIN:
            return self.__connectLocalConnection(conParams)
        elif domType in sd.BLOCK_DOMAIN_TYPES:
            return self.__connectiSCSIServer(conParams)
        else:
            raise se.InvalidParameterException("type", domType)
Example #4
0
    def validate(self, domType, conList):
        """
        Validate that we can connect to a storage server.
        """
        self.log.info("Request to validate %s storage server",
                      sd.type2name(domType))
        conParams = self.__validateConnectionParams(domType, conList)

        if domType == sd.NFS_DOMAIN:
            return self.__validateFileServer(conParams, fileUtils.FSTYPE_NFS)
        elif domType == sd.LOCALFS_DOMAIN:
            return self.__validateLocalConnection(conParams)
        elif domType in sd.BLOCK_DOMAIN_TYPES:
            return self.__validateiSCSIConnection(conParams)
        else:
            raise se.InvalidParameterException("type", domType)