Skip to content

Commit d364911

Browse files
authored
Merge pull request #6501 from kreczko/kreczko-removing-pre-python2.5-syntax
[integration] replace pre-Python 2.5 ternary syntax
2 parents 2b8e687 + 0cfe58e commit d364911

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/DIRAC/FrameworkSystem/DB/ProxyDB.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def __storeProxy(self, userDN, chain, proxyProvider=None):
308308
result = Registry.getProxyProvidersForDN(userDN)
309309
if not result["OK"]:
310310
return result
311-
proxyProvider = result.get("Value") and result["Value"][0] or "Certificate"
311+
proxyProvider = result["Value"][0] if result.get("Value") else "Certificate"
312312

313313
# Get remaining secs
314314
retVal = chain.getRemainingSecs()

src/DIRAC/ResourceStatusSystem/Command/Command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ class Command:
1212

1313
def __init__(self, args=None, clients=None):
1414

15-
self.apis = (1 and clients) or {}
15+
self.apis = clients if clients else {}
1616
self.masterMode = False
1717
self.onlyCache = False
1818
self.metrics = {"failed": []}
1919

2020
self.args = {"onlyCache": False}
21-
_args = (1 and args) or {}
21+
_args = args if args else {}
2222
self.args.update(_args)
2323
self.log = gLogger.getSubLogger(self.__class__.__name__)
2424

src/DIRAC/ResourceStatusSystem/Utilities/RSSCache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, lifeTime, updateFunc=None, cacheHistoryLifeTime=None):
2424

2525
self.__lifeTime = lifeTime
2626
# lifetime of the history on hours
27-
self.__cacheHistoryLifeTime = (1 and cacheHistoryLifeTime) or 24
27+
self.__cacheHistoryLifeTime = cacheHistoryLifeTime if cacheHistoryLifeTime else 24
2828
self.__updateFunc = updateFunc
2929

3030
# RSSCache

0 commit comments

Comments
 (0)