Esempio n. 1
0
     msg  ='ERROR: problems checking source file %s existance'%filetocopy
     msg += str(ex)
     if self.debug : print '\t'+msg+'\n\t'+str(ex.detail)+''
     raise Exception(msg)
 ## when the client commands are not found (wrong env or really missing)
 except MissingCommand, ex:
     ErCode = '10041'
     msg = "ERROR %s %s" %(str(ex), str(ex.detail))
     return ErCode, msg
 if not checkSource :
     ErCode = '60302'
     msg = "ERROR file %s does not exist"%os.path.basename(filetocopy)
     return ErCode, msg
 f_tocopy=os.path.basename(filetocopy)
 try:
     check = sbi_dest.checkExists( f_tocopy, opt=option, tout = self.subprocesstimeout['exists'] )
     if self.debug : print '\tCheck for remote file %s existance executed '%f_tocopy  
     if self.debug : print '\twith exit code = %s '%check  
 except OperationException, ex:
     msg  = 'ERROR: problems checking if file %s already exist'%filetocopy
     msg += str(ex)
     if self.debug :
         dbgmsg  = '\t'+msg+'\n\t'+str(ex.detail)+''
         dbgmsg += '\t'+str(ex.output)+''
         print dbgmsg
     raise Exception(msg)
 except WrongOption, ex:
     msg  = 'ERROR problems checking if file % already exists'%filetocopy
     msg += str(ex)
     if self.debug :
         msg += '\t'+msg+'\n\t'+str(ex.detail)+''
Esempio n. 2
0
        try:
            Storage = SElement( FullPath(string.strip(endpoint)), protocol )
        except Exception, ex:
            common.logger.debug(traceback.format_exc())
            raise Exception(str(ex))
        try:
            action = SBinterface(Storage, logger = common.logger.logger)
        except Exception, ex:
            common.logger.debug(traceback.format_exc())
            raise Exception(str(ex))

        try:
            options=self.protocolOpt[protocol]
            if protocol == 'srm-lcg':
                options="-d " + options
            check = action.checkExists(opt=options)
            if check is True :
                common.logger.info("WARNING: The stageout directory already exists. Be careful not to accidentally mix outputs from different tasks")
            remoteList=[]
        except Exception, e:
            common.logger.debug(traceback.format_exc())
            raise CrabException("Failure while checking remote dir: "+str(e))

        return remoteList

    def checkProxy(self, minTime=168):
        """
        Function to check the Globus proxy.
        """
        if (self.proxyValid): return
Esempio n. 3
0
     msg  ='ERROR: problems checking source file %s existance'%filetocopy
     msg += str(ex)
     if self.debug : print '\t'+msg+'\n\t'+str(ex.detail)+'\n'
     raise Exception(msg)
 ## when the client commands are not found (wrong env or really missing)
 except MissingCommand, ex:
     ErCode = '10041'
     msg = "ERROR %s %s" %(str(ex), str(ex.detail))
     return ErCode, msg
 if not checkSource :
     ErCode = '60302'
     msg = "ERROR file %s does not exist"%os.path.basename(filetocopy)
     return ErCode, msg
 f_tocopy=os.path.basename(filetocopy)
 try:
     check = sbi_dest.checkExists( f_tocopy, opt=option, tout = self.subprocesstimeout['exists'] )
     if self.debug : print '\tCheck for remote file %s existance executed \n'%f_tocopy  
     if self.debug : print '\twith exit code = %s \n'%check  
 except OperationException, ex:
     msg  = 'ERROR: problems checking if file %s already exist'%filetocopy
     msg += str(ex)
     if self.debug :
         dbgmsg  = '\t'+msg+'\n\t'+str(ex.detail)+'\n'
         dbgmsg += '\t'+str(ex.output)+'\n'
         print dbgmsg
     raise Exception(msg)
 except WrongOption, ex:
     msg  = 'ERROR problems checking if file % already exists'%filetocopy
     msg += str(ex)
     if self.debug :
         msg += '\t'+msg+'\n\t'+str(ex.detail)+'\n'
Esempio n. 4
0
        try:
            Storage = SElement(FullPath(string.strip(endpoint)), protocol)
        except Exception, ex:
            common.logger.debug(traceback.format_exc())
            raise Exception(str(ex))
        try:
            action = SBinterface(Storage, logger=common.logger.logger)
        except Exception, ex:
            common.logger.debug(traceback.format_exc())
            raise Exception(str(ex))

        try:
            options = self.protocolOpt[protocol]
            if protocol == 'srm-lcg':
                options = "-d " + options
            check = action.checkExists(opt=options)
            if check is True:
                common.logger.info(
                    "WARNING: The stageout directory already exists. Be careful not to accidentally mix outputs from different tasks"
                )
            remoteList = []
        except Exception, e:
            common.logger.debug(traceback.format_exc())
            raise CrabException("Failure while checking remote dir: " + str(e))

        return remoteList

    def checkProxy(self, minTime=168):
        """
        Function to check the Globus proxy.
        """