diff --git a/src/WebAppDIRAC/Core/App.py b/src/WebAppDIRAC/Core/App.py
index f41e282d5..93b630877 100644
--- a/src/WebAppDIRAC/Core/App.py
+++ b/src/WebAppDIRAC/Core/App.py
@@ -146,7 +146,7 @@ def bootstrap(self):
message += "The following protocols are provided: %s" % str(aviableProtocols)
gLogger.warn(message)
- self.log.debug(" - %s" % "\n - ".join(["%s = %s" % (k, sslops[k]) for k in sslops]))
+ self.log.debug(" - %s" % "\n - ".join([f"{k} = {sslops[k]}" for k in sslops]))
srv = tornado.httpserver.HTTPServer(self.__app, ssl_options=sslops, xheaders=True)
port = Conf.HTTPSPort()
srv.listen(port)
@@ -164,7 +164,7 @@ def run(self):
bu = Conf.rootURL().strip("/")
urls = []
for proto, port in self.__servers:
- urls.append("%s://0.0.0.0:%s/%s/" % (proto, port, bu))
+ urls.append(f"{proto}://0.0.0.0:{port}/{bu}/")
self.log.always("Listening on %s" % " and ".join(urls))
tornado.autoreload.add_reload_hook(self.__reloadAppCB)
tornado.ioloop.IOLoop.instance().start()
diff --git a/src/WebAppDIRAC/Core/CoreHandler.py b/src/WebAppDIRAC/Core/CoreHandler.py
index 2dbb63520..b7f362145 100644
--- a/src/WebAppDIRAC/Core/CoreHandler.py
+++ b/src/WebAppDIRAC/Core/CoreHandler.py
@@ -14,9 +14,9 @@ def get(self, setup, group, route):
proto = self.request.protocol
if "X-Scheme" in self.request.headers:
proto = self.request.headers["X-Scheme"]
- nurl = "%s://%s%s/" % (proto, self.request.host, o.path)
+ nurl = f"{proto}://{self.request.host}{o.path}/"
if o.query:
- nurl = "%s?%s" % (nurl, o.query)
+ nurl = f"{nurl}?{o.query}"
self.redirect(nurl, permanent=True)
elif self.__action == "sendToRoot":
dest = "/"
@@ -24,5 +24,5 @@ def get(self, setup, group, route):
if rootURL:
dest += "%s/" % rootURL.strip("/")
if setup and group:
- dest += "s:%s/g:%s/" % (setup, group)
+ dest += f"s:{setup}/g:{group}/"
self.redirect(dest)
diff --git a/src/WebAppDIRAC/Lib/Conf.py b/src/WebAppDIRAC/Lib/Conf.py
index e94f7fe1e..c349bf5f8 100644
--- a/src/WebAppDIRAC/Lib/Conf.py
+++ b/src/WebAppDIRAC/Lib/Conf.py
@@ -18,7 +18,7 @@ def getCSValue(opt, defValue=None):
:return: defValue type result
"""
- return gConfig.getValue("%s/%s" % (BASECS, opt), defValue)
+ return gConfig.getValue(f"{BASECS}/{opt}", defValue)
def getCSSections(opt):
@@ -28,7 +28,7 @@ def getCSSections(opt):
:return: S_OK(list)/S_ERROR()
"""
- return gConfig.getSections("%s/%s" % (BASECS, opt))
+ return gConfig.getSections(f"{BASECS}/{opt}")
def getCSOptions(opt):
@@ -38,7 +38,7 @@ def getCSOptions(opt):
:return: S_OK(list)/S_ERROR()
"""
- return gConfig.getOptions("%s/%s" % (BASECS, opt))
+ return gConfig.getOptions(f"{BASECS}/{opt}")
def getCSOptionsDict(opt):
@@ -48,7 +48,7 @@ def getCSOptionsDict(opt):
:return: S_OK(dict)/S_ERROR()
"""
- return gConfig.getOptionsDict("%s/%s" % (BASECS, opt))
+ return gConfig.getOptionsDict(f"{BASECS}/{opt}")
def getTitle():
@@ -235,7 +235,7 @@ def getAuthSectionForHandler(route):
:return: str
"""
- return "%s/Access/%s" % (BASECS, route)
+ return f"{BASECS}/Access/{route}"
@deprecated("This funtion is deprecated, use 'tabs' instead.")
@@ -329,4 +329,4 @@ def getAppSettings(app):
:return: S_OK(dict)/S_ERROR
"""
- return gConfig.getOptionsDictRecursively("%s/%s" % (BASECS, app))
+ return gConfig.getOptionsDictRecursively(f"{BASECS}/{app}")
diff --git a/src/WebAppDIRAC/Lib/SessionData.py b/src/WebAppDIRAC/Lib/SessionData.py
index ed1256a6f..892cbf6f5 100644
--- a/src/WebAppDIRAC/Lib/SessionData.py
+++ b/src/WebAppDIRAC/Lib/SessionData.py
@@ -89,11 +89,11 @@ def __isGroupAuthApp(self, appLoc):
gLogger.error("Application handler does not exists:", appLoc)
return False
if handlerLoc not in self.__handlers:
- gLogger.error("Handler %s required by %s does not exist!" % (handlerLoc, appLoc))
+ gLogger.error(f"Handler {handlerLoc} required by {appLoc} does not exist!")
return False
handler = self.__handlers[handlerLoc]
auth = AuthManager(Conf.getAuthSectionForHandler(handlerLoc))
- gLogger.info("Authorization: %s -> %s" % (dict(self.__credDict), handler.AUTH_PROPS))
+ gLogger.info(f"Authorization: {dict(self.__credDict)} -> {handler.AUTH_PROPS}")
return auth.authQuery("", dict(self.__credDict), handler.AUTH_PROPS)
def __generateSchema(self, base, path):
@@ -106,13 +106,13 @@ def __generateSchema(self, base, path):
"""
# Calculate schema
schema = []
- fullName = "%s/%s" % (base, path)
+ fullName = f"{base}/{path}"
result = gConfig.getSections(fullName)
if not result["OK"]:
return schema
sectionsList = result["Value"]
for sName in sectionsList:
- subSchema = self.__generateSchema(base, "%s/%s" % (path, sName))
+ subSchema = self.__generateSchema(base, f"{path}/{sName}")
if subSchema:
schema.append((sName, subSchema))
result = gConfig.getOptions(fullName)
@@ -120,7 +120,7 @@ def __generateSchema(self, base, path):
return schema
optionsList = result["Value"]
for opName in optionsList:
- opVal = gConfig.getValue("%s/%s" % (fullName, opName))
+ opVal = gConfig.getValue(f"{fullName}/{opName}")
if opVal.startswith("link|"):
schema.append(("link", opName, opVal[5:])) # pylint: disable=unsubscriptable-object
continue
diff --git a/src/WebAppDIRAC/WebApp/handler/AccountingHandler.py b/src/WebAppDIRAC/WebApp/handler/AccountingHandler.py
index f2feb5482..74b3b52bc 100644
--- a/src/WebAppDIRAC/WebApp/handler/AccountingHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/AccountingHandler.py
@@ -58,7 +58,7 @@ def __getUniqueKeyValues(self, typeName):
siteLevel = {}
for siteName in retVal["Value"]["Site"]:
sitePrefix = siteName.split(".")[0].strip()
- level = gConfig.getValue("/Resources/Sites/%s/%s/MoUTierLevel" % (sitePrefix, siteName), 10)
+ level = gConfig.getValue(f"/Resources/Sites/{sitePrefix}/{siteName}/MoUTierLevel", 10)
if level not in siteLevel:
siteLevel[level] = []
siteLevel[level].append(siteName)
diff --git a/src/WebAppDIRAC/WebApp/handler/ComponentHistoryHandler.py b/src/WebAppDIRAC/WebApp/handler/ComponentHistoryHandler.py
index 749d5c43d..d0c2ec090 100644
--- a/src/WebAppDIRAC/WebApp/handler/ComponentHistoryHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/ComponentHistoryHandler.py
@@ -118,7 +118,7 @@ def __request(self):
time = self.get_argument("startTime")
else:
time = "00:00"
- date = datetime.datetime.strptime("%s-%s" % (self.get_argument("startDate"), time), "%Y-%m-%d-%H:%M")
+ date = datetime.datetime.strptime("{}-{}".format(self.get_argument("startDate"), time), "%Y-%m-%d-%H:%M")
req["installation"]["InstallationTime.bigger"] = date
if "endDate" in self.request.arguments and len(self.get_argument("endDate")) > 0:
@@ -126,7 +126,7 @@ def __request(self):
time = self.get_argument("endTime")
else:
time = "00:00"
- date = datetime.datetime.strptime("%s-%s" % (self.get_argument("endDate"), time), "%Y-%m-%d-%H:%M")
+ date = datetime.datetime.strptime("{}-{}".format(self.get_argument("endDate"), time), "%Y-%m-%d-%H:%M")
req["installation"]["UnInstallationTime.smaller"] = date
return req
diff --git a/src/WebAppDIRAC/WebApp/handler/ConfigurationManagerHandler.py b/src/WebAppDIRAC/WebApp/handler/ConfigurationManagerHandler.py
index 434fb3054..04e28cadf 100644
--- a/src/WebAppDIRAC/WebApp/handler/ConfigurationManagerHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/ConfigurationManagerHandler.py
@@ -146,7 +146,7 @@ def __htmlComment(self, rawComment):
continue
commentLines.append(line)
if commentLines or commiter:
- return "%s%s" % ("
".join(commentLines), commiter)
+ return "{}{}".format("
".join(commentLines), commiter)
return False
def __showConfigurationAsText(self):
@@ -174,7 +174,7 @@ def __setOptionValue(self, params):
self.__configData["cfgData"].setOptionValue(optionPath, optionValue)
if self.__configData["cfgData"].getValue(optionPath) == optionValue:
- self.log.info("Set option value", "%s = %s" % (optionPath, optionValue))
+ self.log.info("Set option value", f"{optionPath} = {optionValue}")
return {"success": 1, "op": "setOptionValue", "parentNodeId": params["parentNodeId"], "value": optionValue}
return {"success": 0, "op": "setOptionValue", "message": "Can't update %s" % optionPath}
@@ -188,7 +188,7 @@ def __setComment(self, params):
self.__setCommiter()
self.__configData["cfgData"].setComment(path, value)
- self.log.info("Set comment", "%s = %s" % (path, value))
+ self.log.info("Set comment", f"{path} = {value}")
return {
"success": 1,
"op": "setComment",
@@ -303,8 +303,8 @@ def __createOption(self, params):
return {"success": 0, "op": "createOption", "message": "Options can't have a / in the name"}
if len(optionValue) == 0:
return {"success": 0, "op": "createOption", "message": "Options should have values!"}
- optionPath = "%s/%s" % (parentPath, optionName)
- self.log.info("Creating option", "%s = %s" % (optionPath, optionValue))
+ optionPath = f"{parentPath}/{optionName}"
+ self.log.info("Creating option", f"{optionPath} = {optionValue}")
if not self.__configData["cfgData"].existsOption(optionPath):
self.__setCommiter()
self.__configData["cfgData"].setOptionValue(optionPath, optionValue)
@@ -336,9 +336,7 @@ def __moveNode(self, params):
"oldIndex": params["oldIndex"],
}
- self.log.info(
- "Moving node", "Moving %s under %s before pos %s" % (nodePath, destinationParentPath, beforeOfIndex)
- )
+ self.log.info("Moving node", f"Moving {nodePath} under {destinationParentPath} before pos {beforeOfIndex}")
cfgData = self.__configData["cfgData"].getCFG()
nodeDict = cfgData.getRecursive(nodePath)
@@ -584,7 +582,7 @@ def __rollback(self, params):
return {"success": 0, "op": "rollback", "message": retVal["Value"]}
def __setCommiter(self):
- commiter = "%s@%s - %s" % (
+ commiter = "{}@{} - {}".format(
self.getUserName(),
self.getUserGroup(),
datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S"),
@@ -610,7 +608,7 @@ def __download(self):
version = str(self.__configData["cfgData"].getCFG()["DIRAC"]["Configuration"]["Version"])
configName = str(self.__configData["cfgData"].getCFG()["DIRAC"]["Configuration"]["Name"])
- fileName = "cs.%s.%s" % (configName, version.replace(":", "").replace("-", "").replace(" ", ""))
+ fileName = "cs.{}.{}".format(configName, version.replace(":", "").replace("-", "").replace(" ", ""))
return {"success": 1, "op": "download", "result": self.__configData["strCfgData"], "fileName": fileName}
diff --git a/src/WebAppDIRAC/WebApp/handler/DowntimesHandler.py b/src/WebAppDIRAC/WebApp/handler/DowntimesHandler.py
index 75ea49294..cf522c9f4 100644
--- a/src/WebAppDIRAC/WebApp/handler/DowntimesHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/DowntimesHandler.py
@@ -76,11 +76,11 @@ def web_getDowntimesData(
requestParams["startDate"] = datetime.utcnow()
if startDate and startTime:
- requestParams["startDate"] = datetime.strptime("%s %s" % (startDate, startTime), "%Y-%m-%d %H:%M")
+ requestParams["startDate"] = datetime.strptime(f"{startDate} {startTime}", "%Y-%m-%d %H:%M")
requestParams["endDate"] = datetime.utcnow()
if endDate and endTime:
- requestParams["endDate"] = datetime.strptime("%s %s" % (endDate, endTime), "%Y-%m-%d %H:%M")
+ requestParams["endDate"] = datetime.strptime(f"{endDate} {endTime}", "%Y-%m-%d %H:%M")
gLogger.info("Request parameters:", requestParams)
diff --git a/src/WebAppDIRAC/WebApp/handler/FileCatalogHandler.py b/src/WebAppDIRAC/WebApp/handler/FileCatalogHandler.py
index 1fd3608e7..4a6e6ebda 100644
--- a/src/WebAppDIRAC/WebApp/handler/FileCatalogHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/FileCatalogHandler.py
@@ -80,7 +80,7 @@ def web_getSelectedFiles(self, archivePath=None, lfnPath=None):
pos_relative = absolutePath.find("/", pos_relative + 1)
pos_relative = pos_relative + 1
relativePath = absolutePath[pos_relative:]
- gLogger.always("relativePath %s, file %s" % (relativePath, filename))
+ gLogger.always(f"relativePath {relativePath}, file {filename}")
zFile.write(os.path.join(absolutePath, filename))
zFile.close()
shutil.rmtree(tmpdir)
@@ -239,7 +239,7 @@ def web_getFilesData(self, limit=25, start=0, lfnPath=None, **kwargs):
meta = ""
if "Metadata" in value:
m = value["Metadata"]
- meta = "; ".join(["%s: %s" % (i, j) for (i, j) in m.items()])
+ meta = "; ".join([f"{i}: {j}" for (i, j) in m.items()])
dirnameList = key.split("/")
dirname = "/".join(dirnameList[: len(dirnameList) - 1])
diff --git a/src/WebAppDIRAC/WebApp/handler/JobLaunchpadHandler.py b/src/WebAppDIRAC/WebApp/handler/JobLaunchpadHandler.py
index 971b5caad..ba4408b46 100644
--- a/src/WebAppDIRAC/WebApp/handler/JobLaunchpadHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/JobLaunchpadHandler.py
@@ -61,7 +61,7 @@ def __getProxyStatus(self):
defaultSeconds = 24 * 3600 + 60 # 24H + 1min
validSeconds = gConfig.getValue("/Registry/DefaultProxyLifeTime", defaultSeconds)
- gLogger.info("\033[0;31m userHasProxy(%s, %s, %s) \033[0m" % (userDN, group, validSeconds))
+ gLogger.info(f"\033[0;31m userHasProxy({userDN}, {group}, {validSeconds}) \033[0m")
if (result := proxyManager.userHasProxy(userDN, group, validSeconds))["OK"]:
return {"success": "true", "result": "true" if result["Value"] else "false"}
diff --git a/src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py b/src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py
index 928230514..3528beb94 100644
--- a/src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/JobMonitorHandler.py
@@ -471,7 +471,7 @@ def web_getSandbox(self, jobID: int = None, sandbox: str = "Output", check=None)
return {"success": "true"}
data = result["Value"]
- fname = "%s_%sSandbox.tar" % (str(jobID), sandbox)
+ fname = f"{str(jobID)}_{sandbox}Sandbox.tar"
self.set_header("Content-type", "application/x-tar")
self.set_header("Content-Disposition", 'attachment; filename="%s"' % fname)
self.set_header("Content-Length", len(data))
diff --git a/src/WebAppDIRAC/WebApp/handler/JobSummaryHandler.py b/src/WebAppDIRAC/WebApp/handler/JobSummaryHandler.py
index 0f4e4305c..8fb9fa5b8 100644
--- a/src/WebAppDIRAC/WebApp/handler/JobSummaryHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/JobSummaryHandler.py
@@ -322,7 +322,7 @@ def web_getSelectionData(self):
def web_getData(self):
pagestart = time()
result = self.__request()
- gLogger.always("getSiteSummaryWeb(%s,%s,%s,%s)" % (result, self.globalSort, self.pageNumber, self.numberOfJobs))
+ gLogger.always(f"getSiteSummaryWeb({result},{self.globalSort},{self.pageNumber},{self.numberOfJobs})")
retVal = WMSAdministratorClient().getSiteSummaryWeb(result, [], self.pageNumber, self.numberOfJobs)
gLogger.always("\033[0;31m YO: \033[0m", result)
if retVal["OK"]:
diff --git a/src/WebAppDIRAC/WebApp/handler/MonitoringHandler.py b/src/WebAppDIRAC/WebApp/handler/MonitoringHandler.py
index 0733d51dd..d0ec25a5c 100644
--- a/src/WebAppDIRAC/WebApp/handler/MonitoringHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/MonitoringHandler.py
@@ -31,7 +31,7 @@ def __getUniqueKeyValues(self, typeName):
siteLevel = {}
for siteName in retVal["Value"]["Site"]:
sitePrefix = siteName.split(".")[0].strip()
- level = gConfig.getValue("/Resources/Sites/%s/%s/MoUTierLevel" % (sitePrefix, siteName), 10)
+ level = gConfig.getValue(f"/Resources/Sites/{sitePrefix}/{siteName}/MoUTierLevel", 10)
if level not in siteLevel:
siteLevel[level] = []
siteLevel[level].append(siteName)
diff --git a/src/WebAppDIRAC/WebApp/handler/RootHandler.py b/src/WebAppDIRAC/WebApp/handler/RootHandler.py
index 77fea2ced..b8ffdcdea 100644
--- a/src/WebAppDIRAC/WebApp/handler/RootHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/RootHandler.py
@@ -74,7 +74,9 @@ def web_login(self, provider, next="/DIRAC", **kwargs):
cli = result["Value"]
cli.scope = ""
if provider:
- cli.metadata["authorization_endpoint"] = "%s/%s" % (cli.get_metadata("authorization_endpoint"), provider)
+ cli.metadata["authorization_endpoint"] = "{}/{}".format(
+ cli.get_metadata("authorization_endpoint"), provider
+ )
uri, state, session = cli.submitNewSession()
diff --git a/src/WebAppDIRAC/WebApp/handler/SystemAdministrationHandler.py b/src/WebAppDIRAC/WebApp/handler/SystemAdministrationHandler.py
index 9537742dd..ebedeec90 100644
--- a/src/WebAppDIRAC/WebApp/handler/SystemAdministrationHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/SystemAdministrationHandler.py
@@ -27,7 +27,7 @@ def web_getSysInfo(self):
callback[i]["Host"] = callback[i]["HostName"]
callback[i]["Timestamp"] = str(callback[i].get("Timestamp", "unknown"))
# We have to keep the backward compatibility (this can heppen when we do not update one host to v6r15 ...
- callback[i]["DIRAC"] = "%s,%s" % (
+ callback[i]["DIRAC"] = "{},{}".format(
callback[i].get("DIRACVersion", callback[i].get("DIRAC", "")),
callback[i].get("Extension", callback[i].get("Extensions", "")),
)
diff --git a/src/WebAppDIRAC/WebApp/handler/TransformationMonitorHandler.py b/src/WebAppDIRAC/WebApp/handler/TransformationMonitorHandler.py
index e7da053b8..550be5667 100644
--- a/src/WebAppDIRAC/WebApp/handler/TransformationMonitorHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/TransformationMonitorHandler.py
@@ -357,7 +357,7 @@ def web_getTier1Sites(self):
return {"success": True, "data": tier1}
def web_setSite(self, TransformationId: int, RunNumber: int, Site):
- gLogger.info("\033[0;31m setTransformationRunsSite(%s, %s, %s) \033[0m" % (TransformationId, RunNumber, Site))
+ gLogger.info(f"\033[0;31m setTransformationRunsSite({TransformationId}, {RunNumber}, {Site}) \033[0m")
result = TransformationClient().setTransformationRunsSite(TransformationId, RunNumber, Site)
if result["OK"]:
return {"success": "true", "result": "true"}
diff --git a/src/WebAppDIRAC/WebApp/handler/UPHandler.py b/src/WebAppDIRAC/WebApp/handler/UPHandler.py
index f93814c2d..5d9985e74 100644
--- a/src/WebAppDIRAC/WebApp/handler/UPHandler.py
+++ b/src/WebAppDIRAC/WebApp/handler/UPHandler.py
@@ -31,7 +31,7 @@ def web_saveAppState(self, obj, app, name, state):
:return: dict
"""
- up = UserProfileClient("Web/%s/%s" % (obj, app))
+ up = UserProfileClient(f"Web/{obj}/{app}")
data = base64.b64encode(zlib.compress(DEncode.encode(state), 9))
# before we save the state (modify the state) we have to remember the actual access: ReadAccess and PublishAccess
result = up.getVarPermissions(name)
@@ -58,7 +58,7 @@ def web_makePublicAppState(self, obj, app, name, access="ALL"):
:return: dict
"""
- up = UserProfileClient("Web/%s/%s" % (obj, app))
+ up = UserProfileClient(f"Web/{obj}/{app}")
access = access.upper()
if access not in ("ALL", "VO", "GROUP", "USER"):
raise WErr(400, "Invalid access")
@@ -80,7 +80,7 @@ def web_loadAppState(self, obj, app, name):
:return: dict
"""
- result = UserProfileClient("Web/%s/%s" % (obj, app)).retrieveVar(name)
+ result = UserProfileClient(f"Web/{obj}/{app}").retrieveVar(name)
if not result["OK"]:
return result
data = result["Value"]
@@ -97,7 +97,7 @@ def web_loadUserAppState(self, obj, app, user, group, name):
:return: dict
"""
- up = UserProfileClient("Web/%s/%s" % (obj, app))
+ up = UserProfileClient(f"Web/{obj}/{app}")
result = up.retrieveVarFromUser(user, group, name)
if not result["OK"]:
return result
@@ -113,7 +113,7 @@ def web_listAppState(self, obj, app):
:return: dict
"""
- up = UserProfileClient("Web/%s/%s" % (obj, app))
+ up = UserProfileClient(f"Web/{obj}/{app}")
result = up.retrieveAllVars()
if not result["OK"]:
return result
@@ -130,7 +130,7 @@ def web_delAppState(self, obj, app, name):
:return: dict
"""
- return UserProfileClient("Web/%s/%s" % (obj, app)).deleteVar(name)
+ return UserProfileClient(f"Web/{obj}/{app}").deleteVar(name)
@authorization(["all"])
def web_listPublicDesktopStates(self, obj, app):
@@ -141,7 +141,7 @@ def web_listPublicDesktopStates(self, obj, app):
:return: dict
"""
- up = UserProfileClient("Web/%s/%s" % (obj, app))
+ up = UserProfileClient(f"Web/{obj}/{app}")
result = up.listAvailableVars()
if not result["OK"]:
return result
@@ -194,7 +194,7 @@ def web_changeView(self, obj, app, desktop, view):
:return: dict
"""
- up = UserProfileClient("Web/%s/%s" % (obj, app))
+ up = UserProfileClient(f"Web/{obj}/{app}")
result = up.retrieveVar(desktop)
if not result["OK"]:
return result
@@ -216,7 +216,7 @@ def web_listPublicStates(self, obj, app):
"""
user = self.getUserName()
- up = UserProfileClient("Web/%s/%s" % (obj, app))
+ up = UserProfileClient(f"Web/{obj}/{app}")
retVal = up.getUserProfileNames({"PublishAccess": "ALL"})
if not retVal["OK"]:
raise WErr.fromSERROR(retVal)
@@ -291,7 +291,7 @@ def web_publishAppState(self, obj, app, name, access="ALL"):
:return: dict
"""
- up = UserProfileClient("Web/%s/%s" % (obj, app))
+ up = UserProfileClient(f"Web/{obj}/{app}")
access = access.upper()
if access not in ("ALL", "VO", "GROUP", "USER"):
raise WErr(400, "Invalid access")
diff --git a/src/WebAppDIRAC/scripts/dirac_webapp_run.py b/src/WebAppDIRAC/scripts/dirac_webapp_run.py
index 708e7b75c..ce1309e46 100755
--- a/src/WebAppDIRAC/scripts/dirac_webapp_run.py
+++ b/src/WebAppDIRAC/scripts/dirac_webapp_run.py
@@ -34,7 +34,7 @@ def _createStaticSymlinks(targetDir):
# If there is more than one suffix append a counter
if i >= 1:
destination += "-%s" % i
- gLogger.notice(" creating symlink from", "%s to %s" % (path, destination))
+ gLogger.notice(" creating symlink from", f"{path} to {destination}")
if os.path.islink(destination):
if path == os.readlink(destination):
# The link is already up to date
@@ -68,7 +68,9 @@ def _checkDIRACVersion():
dirac_spec = deps[0].specifier
if dirac_version not in dirac_spec:
raise RuntimeError(
- "WebAppDIRAC %s requires %s but %s is incompatible" % (version("WebAppDIRAC"), dirac_version, dirac_spec)
+ "WebAppDIRAC {} requires {} but {} is incompatible".format(
+ version("WebAppDIRAC"), dirac_version, dirac_spec
+ )
)