diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-12-11 18:27:50 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-12-11 18:27:50 +0000 |
commit | a650decc8033acc0db8930b08d669512a8d81ea8 (patch) | |
tree | b7aee8dc056a285bbac06c976c3dffc2d5b073b0 /src/lib/Server/Plugins/SSHbase.py | |
parent | a7ece7e20bfe49b9f3391934b4e18015f333d0ec (diff) | |
download | bcfg2-a650decc8033acc0db8930b08d669512a8d81ea8.tar.gz bcfg2-a650decc8033acc0db8930b08d669512a8d81ea8.tar.bz2 bcfg2-a650decc8033acc0db8930b08d669512a8d81ea8.zip |
Add dynamic key prefix support
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2584 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/SSHbase.py')
-rw-r--r-- | src/lib/Server/Plugins/SSHbase.py | 12 |
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'): |