40
40
import sys
41
41
42
42
import arc # Has to work if this module is called #pylint: disable=import-error
43
- from DIRAC import S_OK , S_ERROR , gConfig
44
- from DIRAC .ConfigurationSystem .Client .Helpers .Resources import getCESiteMapping
43
+ from DIRAC import S_OK , S_ERROR
45
44
from DIRAC .Core .Utilities .Subprocess import shellCall
46
45
from DIRAC .Core .Utilities .File import makeGuid
47
46
from DIRAC .Core .Utilities .List import breakListIntoChunks
@@ -113,14 +112,14 @@ def _getARCJob(self, jobID):
113
112
j .JobStatusURL = arc .URL (str (statURL ))
114
113
j .JobStatusInterfaceName = "org.nordugrid.ldapng"
115
114
116
- mangURL = "gsiftp://%s :2811/jobs/" % ( self . ceHost )
115
+ mangURL = f "gsiftp://{ self . ceHost } :2811/jobs/"
117
116
j .JobManagementURL = arc .URL (str (mangURL ))
118
117
j .JobManagementInterfaceName = "org.nordugrid.gridftpjob"
119
118
120
119
j .ServiceInformationURL = j .JobManagementURL
121
120
j .ServiceInformationInterfaceName = "org.nordugrid.ldapng"
122
121
else :
123
- commonURL = "https://%s :8443/arex" % self . ceHost
122
+ commonURL = f "https://{ self . ceHost } :8443/arex"
124
123
j .JobStatusURL = arc .URL (str (commonURL ))
125
124
j .JobStatusInterfaceName = "org.ogf.glue.emies.activitymanagement"
126
125
@@ -191,7 +190,7 @@ def _writeXRSL(self, executableFile, inputs=None, outputs=None, executables=None
191
190
if not isinstance (outputs , list ):
192
191
outputs = [outputs ]
193
192
for outputFile in outputs :
194
- xrslOutputs += '(%s "")' % ( outputFile )
193
+ xrslOutputs += f'( { outputFile } "")'
195
194
196
195
xrsl = """
197
196
&(executable="{executable}")
@@ -250,7 +249,7 @@ def _reset(self):
250
249
if logLevel :
251
250
arc .Logger_getRootLogger ().removeDestinations ()
252
251
if logLevel not in self ._arcLevels :
253
- self .log .warn ("ARCLogLevel input is not known:" , "%s not in %s" % ( logLevel , self ._arcLevels ) )
252
+ self .log .warn ("ARCLogLevel input is not known:" , f" { logLevel } not in { self ._arcLevels } " )
254
253
else :
255
254
logstdout = arc .LogStream (sys .stdout )
256
255
logstdout .setFormat (arc .ShortFormat )
@@ -272,7 +271,7 @@ def submitJob(self, executableFile, proxy, numberOfJobs=1, inputs=None, outputs=
272
271
return result
273
272
self .usercfg .ProxyPath (os .environ ["X509_USER_PROXY" ])
274
273
275
- self .log .verbose ("Executable file path: %s" % executableFile )
274
+ self .log .verbose (f "Executable file path: { executableFile } " )
276
275
if not os .access (executableFile , 5 ):
277
276
os .chmod (executableFile , stat .S_IRWXU | stat .S_IRGRP | stat .S_IXGRP | stat .S_IROTH + stat .S_IXOTH )
278
277
@@ -299,8 +298,8 @@ def submitJob(self, executableFile, proxy, numberOfJobs=1, inputs=None, outputs=
299
298
jobdescs = arc .JobDescriptionList ()
300
299
# Get the job into the ARC way
301
300
xrslString , diracStamp = self ._writeXRSL (executableFile , inputs , outputs , executables )
302
- self .log .debug ("XRSL string submitted : %s" % xrslString )
303
- self .log .debug ("DIRAC stamp for job : %s" % diracStamp )
301
+ self .log .debug (f "XRSL string submitted : { xrslString } " )
302
+ self .log .debug (f "DIRAC stamp for job : { diracStamp } " )
304
303
# The arc bindings don't accept unicode objects in Python 2 so xrslString must be explicitly cast
305
304
result = arc .JobDescription .Parse (str (xrslString ), jobdescs )
306
305
if not result :
0 commit comments