diff options
author | Frédéric Péters <fpeters@entrouvert.com> | 2020-12-30 11:14:02 (GMT) |
---|---|---|
committer | Frédéric Péters <fpeters@entrouvert.com> | 2020-12-30 11:14:02 (GMT) |
commit | f419cbd69ce24344ea2744a1e65a35efe63efa65 (patch) | |
tree | 221b84c0ed2971800728037cffdb382236a5785e | |
parent | 3f2f4786318f0ed011ff2190736a0ee8ffb5161b (diff) | |
download | misc-fred-f419cbd69ce24344ea2744a1e65a35efe63efa65.zip misc-fred-f419cbd69ce24344ea2744a1e65a35efe63efa65.tar.gz misc-fred-f419cbd69ce24344ea2744a1e65a35efe63efa65.tar.bz2 |
eoptasks: add 1st fqdn part without trailing digits as keyword
-rwxr-xr-x | eoptasks/eoptasks.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/eoptasks/eoptasks.py b/eoptasks/eoptasks.py index f1d1927..7aab5a3 100755 --- a/eoptasks/eoptasks.py +++ b/eoptasks/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 '<Server %s %r>' % (self.name, self.keywords) |