Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Core/scripts/dirac-install-extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

"""

from __future__ import unicode_literals, absolute_import, division, print_function
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

import os
import sys
import six
import time
import getopt
import importlib

Expand Down
15 changes: 5 additions & 10 deletions Core/scripts/dirac-platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,12 @@
__RCSID__ = "$Id$"

import sys
import getopt
import argparse

cmdOpt = ('h', 'help', 'help doc string')

optList, args = getopt.getopt(sys.argv[1:], cmdOpt[0], cmdOpt[1])
for opt, value in optList:
if opt in ('-h', '--help'):
print(__doc__)
print('Options::\n\n')
print(" %s %s : %s" % (cmdOpt[0].ljust(3), cmdOpt[1].ljust(20), cmdOpt[2]))
sys.exit(0)
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.parse_known_args()

try:
from DIRAC.Core.Utilities.Platform import getPlatformString
Expand Down
18 changes: 6 additions & 12 deletions Core/scripts/dirac-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@

__RCSID__ = "$Id$"

import sys
import getopt

cmdOpt = ('h', 'help', 'help doc string')

optList, args = getopt.getopt(sys.argv[1:], cmdOpt[0], cmdOpt[1])
for opt, value in optList:
if opt in ('-h', '--help'):
print(__doc__)
print('Options::\n\n')
print(" %s %s : %s" % (cmdOpt[0].ljust(3), cmdOpt[1].ljust(20), cmdOpt[2]))
sys.exit(0)
import argparse

parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.parse_known_args()

import DIRAC
print(DIRAC.version)
9 changes: 4 additions & 5 deletions WorkloadManagementSystem/Agent/JobAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ def execute(self):
if runningJobs:
self.log.info('No available slots', '%d running jobs' % runningJobs)
return S_OK('Job Agent cycle complete with %d running jobs' % runningJobs)
else:
self.log.info('CE is not available')
return self.__finish('CE Not Available')
self.log.info('CE is not available (and there are no running jobs)')
return self.__finish('CE Not Available')

result = self.computingElement.getDescription()
if not result['OK']:
Expand Down Expand Up @@ -613,8 +612,8 @@ def __finish(self, message, stop=True):
'with message "%s", execution complete.' % message)
self.am_stopExecution()
return S_ERROR(message)
else:
return S_OK(message)

return S_OK(message)

#############################################################################
def _rescheduleFailedJob(self, jobID, message, stop=True):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,17 @@ def _getCSDict(self):
if localCEType is not None:
pilotDict['CEs'][ce].setdefault('LocalCEType', localCEType)

queueList = gConfig.getSections('/Resources/Sites/' + grid + '/' + site + '/CEs/' + ce + '/Queues/')
res = gConfig.getSections('/Resources/Sites/' + grid + '/' + site + '/CEs/' + ce + '/Queues/')
if not res['OK']:
# Skip but log it
self.log.error("No queues found for CE", ce + ': ' + res['Message'])
continue
queueList = res['Value']
for queue in queueList:
localCEType = gConfig.getValue(
'/Resources/Sites/' + grid + '/' + site + '/CEs/' + ce + '/' + queue + '/LocalCEType')
'/Resources/Sites/' + grid + '/' + site + '/CEs/' + ce + '/Queues/' + queue + '/LocalCEType')
if localCEType is not None:
pilotDict['CEs'][ce][queue].setdefault('LocalCEType', localCEType)
pilotDict['CEs'][ce].setdefault(queue, {'LocalCEType': localCEType})

defaultSetup = gConfig.getValue('/DIRAC/DefaultSetup')
if defaultSetup:
Expand Down