Skip to content

Commit

Permalink
Merge pull request #4046 from qunox/xrootenable
Browse files Browse the repository at this point in the history
enable xrootd url output
  • Loading branch information
mmascher committed Apr 11, 2014
2 parents 578fca1 + 5117f7c commit cf18bdf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/python/CRABClient/Commands/SubCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def __call__(self):
def terminate(self, exitcode):
#We do not want to print logfile for each command...
if exitcode < 2000:
if getattr(self.options, 'dump', False):
if getattr(self.options, 'dump', False) or getattr(self.options, 'xroot', False):
self.logger.debug("Log file is %s" % os.path.abspath(self.logfile))
else:
self.logger.info("Log file is %s" % os.path.abspath(self.logfile))
Expand Down
18 changes: 15 additions & 3 deletions src/python/CRABClient/Commands/getcommand.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

from CRABClient.Commands import CommandResult, mergeResults
from CRABClient.Commands.remote_copy import remote_copy
from CRABClient.Commands.SubCommand import SubCommand
Expand Down Expand Up @@ -34,8 +35,8 @@ def __call__(self, **argv):
elif not os.path.isdir( self.dest ):
raise ConfigurationException('Destination directory is a file')

if self.options.dump:
self.logger.debug("Setting the destination to %s " % self.dest )
if self.options.dump or self.options.xroot:
self.logger.debug("Getting url info")
else:
self.logger.info("Setting the destination to %s " % self.dest )

Expand Down Expand Up @@ -67,7 +68,11 @@ def __call__(self, **argv):
workflow = dictresult['result'] #TODO assigning workflow to dictresult. for the moment we have only one wf
arglist = ['-d', self.dest, '-i', workflow, '-t', self.options.task, '-p', self.proxyfilename, '-l',self.options.nparallel, '-w',self.options.waittime]
if len(workflow) > 0:
if self.dump:
if self.options.xroot:
self.logger.debug("XRootD url is requested")
for fileinfo in workflow:
self.logger.info("root://cms-xrd-global.cern.ch/%s" % fileinfo['lfn'])
elif self.dump:
for fileInfo in workflow:
self.logger.info(fileInfo['pfn'])
else:
Expand Down Expand Up @@ -102,6 +107,12 @@ def setOptions(self):
action = 'store_true',
help = 'Instead of performing the transfer, dump the source URLs.' )

self.parser.add_option( '-x', '--xrootd',
dest = 'xroot',
default = False,
action = 'store_true',
help = 'Give XrootD url for the file' )

self.parser.add_option( '-i', '--jobids',
dest = 'jobids',
default = None,
Expand Down Expand Up @@ -131,3 +142,4 @@ def validateOptions(self):

self.dump = self.options.dump


0 comments on commit cf18bdf

Please sign in to comment.