Refuse to submit jobs if user doesn't have enough time remaining on their stored proxy
There has been a couple of cases where test jobs couldn't be ran due to the user's proxy only having a few days left. We should refuse to submit jobs if this is the case.
This can be done by modifying submit.py
to check with something like:
In [1]: import DIRAC
...: DIRAC.initialize()
...: from DIRAC.Core.Utilities.ReturnValues import returnValueOrRaise
...: from DIRAC.FrameworkSystem.Client.ProxyManagerClient import ProxyManagerClient
...: from DIRAC.Core.Security.ProxyInfo import getProxyInfo
...: from DIRAC.ConfigurationSystem.Client.Helpers import Registry
...: username = returnValueOrRaise(getProxyInfo())["username"]
...: userDNs = returnValueOrRaise(Registry.getDNForUsername(username))
...: returnValueOrRaise(ProxyManagerClient().getDBContents({"UserDN": userDNs}))
Out[1]:
{'ParameterNames': ('UserName',
'UserDN',
'UserGroup',
'ExpirationTime',
'PersistentFlag'),
'Records': [['cburr',
'/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=cburr/CN=761704/CN=Chris Burr',
'',
datetime.datetime(2025, 1, 18, 14, 49, 31),
False]],
'TotalRecords': 1}