From 5b7c51b12718c9c75a1fa877549e92577fc8dfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 30 Dec 2020 12:14:02 +0100 Subject: [PATCH] add 1st fqdn part without trailing digits as keyword --- eoptasks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eoptasks.py b/eoptasks.py index f1d1927..7aab5a3 100755 --- a/eoptasks.py +++ b/eoptasks.py @@ -69,6 +69,11 @@ class Server: for j in range(i, len(parts)): if i != j: self.keywords.add('.'.join(parts[i:j+1])) + if i == 0: + # add first component without trailing digits, this allows + # matching db1.prod.saas.entrouvert.org with the db + # keyword. + self.keywords.add(re.sub(r'\d+$', '', parts[0])) def __repr__(self): return '' % (self.name, self.keywords)