diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2008-01-22 20:54:25 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2008-01-22 20:54:25 +0000 |
commit | d40712a030306d98e67fdfe6301bd71f280fd110 (patch) | |
tree | 65da90e101e2e31d3e5a63139ec627efafc8d0b1 /src/lib/Server | |
parent | bfef1b1c41c96c55033e334fe833e030ced8c450 (diff) | |
download | bcfg2-d40712a030306d98e67fdfe6301bd71f280fd110.tar.gz bcfg2-d40712a030306d98e67fdfe6301bd71f280fd110.tar.bz2 bcfg2-d40712a030306d98e67fdfe6301bd71f280fd110.zip |
Implement support for .static files of external public keys
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4281 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Plugins/SSHbase.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/SSHbase.py b/src/lib/Server/Plugins/SSHbase.py index 9064570a8..4254ad6d9 100644 --- a/src/lib/Server/Plugins/SSHbase.py +++ b/src/lib/Server/Plugins/SSHbase.py @@ -61,7 +61,13 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.DirectoryBacked): def get_skn(self): '''build memory cache of the ssh known hosts file''' if not self.__skn: - self.__skn = '' + static_entries = [key for key in self.entries \ + if key.endswith('.static')] + if static_entries: + self.__skn = "\n".join([self.entries[key].data for \ + key in static_entries]) + else: + self.__skn = '' pubkeys = [pubk for pubk in self.entries.keys() \ if pubk.find('.pub.H_') != -1] pubkeys.sort() @@ -86,6 +92,8 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.DirectoryBacked): Bcfg2.Server.Plugin.DirectoryBacked.HandleEvent(self, event) if event and '_key.pub.H_' in event.filename: self.skn = False + if event and event.filename.endswith('.static'): + self.skn = False if not self.skn: if (len(self.entries.keys())) > (0.95 * len(os.listdir(self.data))): a = self.skn |