Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def pbspaths(directory, jobname, suffix):
""" creates filename paths. """
suffix = '{0}-pbs{1}'.format(event.prefix, suffix) if hasprefix \
else 'pbs{0}'.format(suffix)
return str(directory.join(jobname, suffix))
# now loop over jobfolders
pbsscripts = []
for current, path in jobfolders:
logger.info("launch/scattered: current: %s path: %s" % (current, path))
# creates directory.
directory = local_path(path).dirpath()
directory.ensure(dir=True)
# loop over executable folders in current jobfolder
for name, job in current.root.items():
logger.info('launch/scattered: current: %s' % current)
logger.info('launch/scattered: current.root: %s' % current.root)
logger.info('launch/scattered: name: %s' % name)
logger.info('launch/scattered: job: %s' % job)
logger.info('launch/scattered: job.is_tagged: %s' % job.is_tagged)
# avoid jobfolder which are off
if job.is_tagged:
continue
# added by Peter Graf
# avoid jobfolder which is already in the queue:
qstuff = qstat(name)
if (len(qstuff) > 0 and not event.force):
status = [x.split()[2] for x in qstuff]
# status is a list like ['Q'], ['R'], ['H'], ['C'], ['R', 'C'], etc
# 'RHQ' is the status that the job is indeed in the queue, 'C' job completed and
# being removed from the queue if needed, a prefix can be used to distinguish two