summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/SSHbase.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server/Plugins/SSHbase.py')
-rw-r--r--src/lib/Server/Plugins/SSHbase.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/SSHbase.py b/src/lib/Server/Plugins/SSHbase.py
index 80eec4403..6c2c730ca 100644
--- a/src/lib/Server/Plugins/SSHbase.py
+++ b/src/lib/Server/Plugins/SSHbase.py
@@ -29,6 +29,8 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin):
"ssh_host_rsa_key.pub.H_%s", "ssh_host_key.pub.H_%s"]
hostkeys = ["ssh_host_dsa_key.H_%s",
"ssh_host_rsa_key.H_%s", "ssh_host_key.H_%s"]
+ keypatterns = ['ssh_host_dsa_key', 'ssh_host_rsa_key', 'ssh_host_key',
+ 'ssh_host_dsa_key.pub', 'ssh_host_rsa_key.pub', 'ssh_host_key.pub']
def __init__(self, core, datastore):
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
@@ -53,6 +55,16 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin):
self.ipcache = {}
self.__rmi__ = ['GetPubKeys']
+
+ def HandlesEntry(self, entry):
+ '''Handle key entries dynamically'''
+ return entry.tag == 'ConfigFile' and \
+ [fpat for fpat in self.keypatterns if entry.get('name').endswith(fpat)]
+
+ def HandleEntry(self, entry, metadata):
+ '''Bind key data'''
+ return self.build_hk(entry, metadata)
+
def GetPubKeys(self, _):
'''Export public key data'''
if not hasattr(self, 'static_skn'):