import get_experiments

- in case of localhost, remove .psi.ch from normalized host name
+ fix import in t.py
+ allow boolean as selection criterium
This commit is contained in:
2025-02-26 13:43:39 +01:00
parent ef560a8b20
commit e2122fb3a0
4 changed files with 53 additions and 26 deletions

View File

@ -34,10 +34,9 @@ def short_hostname(host):
host = socket.gethostbyaddr(host)[0]
if host == 'localhost':
host = socket.gethostname()
else:
match = re.match(r'([^.-]+)(?:-129129\d{6}|(-[~.]*|)).psi.ch', host)
if match:
host = match.group(1) + (match.group(2) or '')
match = re.match(r'([^.-]+)(?:-129129\d{6}|(-[~.]*|)).psi.ch', host)
if match:
host = match.group(1) + (match.group(2) or '')
return host