def validateOptions(self): """ Check if the output file is given and set as attribute """ SubCommand.validateOptions(self) if self.options.usedbs is not None: msg = "CRAB command option error: the option --dbs has been deprecated since CRAB v3.3.1603." raise UnknownOptionException(msg) recoveryMethods = ['notFinished', 'notPublished', 'failed'] if self.options.recovery not in recoveryMethods: msg = "%sError%s:" % (colors.RED, colors.NORMAL) msg += " The --recovery option only accepts the following values: %s" % ( recoveryMethods) raise ConfigurationException(msg)
def validateOptions(self): """ __validateOptions__ Validate the command line options of the command. Raise a ConfigurationException in case of error; don't do anything if ok. """ if self.cmdconf[ 'requiresTaskOption'] and self.options.oldtask is not None: msg = "CRAB command line option error: the option -t/--task has been renamed to -d/--dir." raise UnknownOptionException(msg) if self.cmdconf['requiresTaskOption'] and self.options.task is None: if len(self.args) == 1 and self.args[0]: self.options.task = self.args[0] elif self.cmdconf['useCache'] and self.crab3dic['taskname'] != None: self.options.task = self.crab3dic['taskname'] else: raise MissingOptionException('ERROR: Task option is required.')