コード例 #1
0
ファイル: uploadlog.py プロジェクト: ddaina/CRABClient
    def __call__(self):
        self.logger.debug("uploadlog started")
        taskname = None
        #veryfing the log file exist
        if self.options.logpath is not None:
            logfilename = str(time.strftime("%Y-%m-%d_%H%M%S")) + '_crab.log'
            self.logfile = self.options.logpath
        elif os.path.isfile(self.logfile):
            self.logger.debug("crab.log exists")
            try:
                taskname = self.cachedinfo['RequestName']
                logfilename = str(taskname) + ".log"
            except:
                self.logger.info(
                    "Couldn't get information from .requestcache (file likely not created due to submission failure), try\n"
                    "'crab uploadlog --logpath=<path-to-log-file-in-project-dir>'"
                )
                return
        else:
            msg = "%sError%s: Could not locate log file." % (colors.RED,
                                                             colors.NORMAL)
            self.logger.info(msg)
            raise ConfigurationException

        self.logger.info("Will upload file %s." % (self.logfile))
        logfileurl = uploadlogfile(self.logger, self.proxyfilename, taskname = taskname, logfilename = logfilename, \
                                   logpath = str(self.logfile), instance = self.instance, \
                                   serverurl = self.serverurl)
        return {'result': {'status': 'SUCCESS', 'logurl': logfileurl}}
コード例 #2
0
ファイル: uploadlog.py プロジェクト: matz-e/CRABClient
    def __call__(self):
        self.logger.debug("uploadlog started")
        #veryfing the log file exist
        if hasattr(self.options, 'logpath') and self.options.logpath != None:
            logfilename = str(time.strftime("%Y-%m-%d_%H%M%S"))+'_crab.log'
            self.logfile = self.options.logpath
        elif path.isfile(self.logfile):
            self.logger.debug("crab.log exists")
            logfilename=str(self.cachedinfo['RequestName'])+".log"
        else:
            self.logger.info("%sError:%s Could not locate log file" % (colors.RED, colors.NORMAL))
            raise ConfigurationException

        logfileurl = uploadlogfile(self.logger, self.proxyfilename, logfilename = logfilename, \
                                   logpath = str(self.logfile), instance = self.instance, \
                                   serverurl = self.serverurl)
        return {'result' : {'status' : 'SUCCESS' , 'logurl' : logfileurl}}
コード例 #3
0
    def __call__(self):
        self.logger.debug("uploadlog started")
        #veryfing the log file exist
        if hasattr(self.options, 'logpath') and self.options.logpath != None:
            logfilename = str(time.strftime("%Y-%m-%d_%H%M%S")) + '_crab.log'
            self.logfile = self.options.logpath
        elif path.isfile(self.logfile):
            self.logger.debug("crab.log exists")
            logfilename = str(self.cachedinfo['RequestName']) + ".log"
        else:
            self.logger.info("%sError:%s Could not locate log file" %
                             (colors.RED, colors.NORMAL))
            raise ConfigurationException

        logfileurl = uploadlogfile(self.logger, self.proxyfilename, logfilename = logfilename, \
                                   logpath = str(self.logfile), instance = self.instance, \
                                   serverurl = self.serverurl)
        return {'result': {'status': 'SUCCESS', 'logurl': logfileurl}}
コード例 #4
0
ファイル: uploadlog.py プロジェクト: blinkseb/CRABClient
    def __call__(self):
        self.logger.debug("uploadlog started")
        # veryfing the log file exist
        if self.options.logpath is not None:
            logfilename = str(time.strftime("%Y-%m-%d_%H%M%S")) + "_crab.log"
            self.logfile = self.options.logpath
        elif os.path.isfile(self.logfile):
            self.logger.debug("crab.log exists")
            logfilename = str(self.cachedinfo["RequestName"]) + ".log"
        else:
            msg = "%sError%s: Could not locate log file." % (colors.RED, colors.NORMAL)
            self.logger.info(msg)
            raise ConfigurationException

        self.logger.info("Will upload file %s." % (self.logfile))
        logfileurl = uploadlogfile(
            self.logger,
            self.proxyfilename,
            logfilename=logfilename,
            logpath=str(self.logfile),
            instance=self.instance,
            serverurl=self.serverurl,
        )
        return {"result": {"status": "SUCCESS", "logurl": logfileurl}}
コード例 #5
0
    def __call__(self):
        self.logger.debug("uploadlog started")
        #veryfing the log file exist
        if self.options.logpath is not None:
            logfilename = str(time.strftime("%Y-%m-%d_%H%M%S"))+'_crab.log'
            self.logfile = self.options.logpath
        elif os.path.isfile(self.logfile):
            self.logger.debug("crab.log exists")
            if hasattr(self, 'cachedinfo') and 'RequestName' in self.cachedinfo:
                logfilename = str(self.cachedinfo['RequestName'])+".log"
            else:
                self.logger.info("Couldn't get information from .requestcache (file likely not created due to submission failure), try\n"
                        "'crab uploadlog --logpath=<path-to-log-file-in-project-dir>'")
                return
        else:
            msg = "%sError%s: Could not locate log file." % (colors.RED, colors.NORMAL)
            self.logger.info(msg)
            raise ConfigurationException

        self.logger.info("Will upload file %s." % (self.logfile))
        logfileurl = uploadlogfile(self.logger, self.proxyfilename, logfilename = logfilename, \
                                   logpath = str(self.logfile), instance = self.instance, \
                                   serverurl = self.serverurl)
        return {'result' : {'status' : 'SUCCESS' , 'logurl' : logfileurl}}