summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/SSHbase.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-11-13 11:07:19 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-11-13 11:07:33 -0500
commit5a6782cf7191a201787da9401f5d61a63255ab09 (patch)
treedf1c3eeeb9edbc6c62fb8867bc58b2c882cc977b /src/lib/Bcfg2/Server/Plugins/SSHbase.py
parentbe25c22019a4a78bc51ec1775fca295376074d5a (diff)
downloadbcfg2-5a6782cf7191a201787da9401f5d61a63255ab09.tar.gz
bcfg2-5a6782cf7191a201787da9401f5d61a63255ab09.tar.bz2
bcfg2-5a6782cf7191a201787da9401f5d61a63255ab09.zip
SSHbase: fixed invalidation of ssh_known_hosts cache
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/SSHbase.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/SSHbase.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/SSHbase.py b/src/lib/Bcfg2/Server/Plugins/SSHbase.py
index ff569334d..4d2529ed6 100644
--- a/src/lib/Bcfg2/Server/Plugins/SSHbase.py
+++ b/src/lib/Bcfg2/Server/Plugins/SSHbase.py
@@ -9,7 +9,7 @@ import logging
import tempfile
from subprocess import Popen, PIPE
import Bcfg2.Server.Plugin
-from Bcfg2.Compat import u_str, reduce, b64encode # pylint: disable=W0622
+from Bcfg2.Compat import any, u_str, reduce, b64encode # pylint: disable=W0622
LOGGER = logging.getLogger(__name__)
@@ -111,9 +111,7 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin,
is regenerated each time a new key is generated.
"""
- name = 'SSHbase'
__author__ = 'bcfg-dev@mcs.anl.gov'
-
keypatterns = ["ssh_host_dsa_key",
"ssh_host_ecdsa_key",
"ssh_host_rsa_key",
@@ -250,7 +248,9 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin,
for entry in list(self.entries.values()):
if entry.specific.match(event.filename):
entry.handle_event(event)
- if event.filename.endswith(".pub"):
+ if any(event.filename.startswith(kp)
+ for kp in self.keypatterns
+ if kp.endswith(".pub")):
self.logger.info("New public key %s; invalidating "
"ssh_known_hosts cache" % event.filename)
self.skn = False