From 286fae75648b2820f37d40a4a98d9c81093f64b6 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 17 Aug 2006 20:41:04 +0000 Subject: Rick's deterministic ordering patch git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2071 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/SSHbase.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/Server/Plugins/SSHbase.py b/src/lib/Server/Plugins/SSHbase.py index bf3aa1e56..80eec4403 100644 --- a/src/lib/Server/Plugins/SSHbase.py +++ b/src/lib/Server/Plugins/SSHbase.py @@ -80,7 +80,9 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin): def cache_skn(self): '''build memory cache of the ssh known hosts file''' self.static_skn = '' - for pubkey in [pubk for pubk in self.repository.entries.keys() if pubk.find('.pub.H_') != -1]: + pubkeys = [pubk for pubk in self.repository.entries.keys() if pubk.find('.pub.H_') != -1] + pubkeys.sort() + for pubkey in pubkeys: hostname = pubkey.split('H_')[1] try: (ipaddr, fqdn) = self.get_ipcache_entry(hostname) @@ -96,8 +98,10 @@ class SSHbase(Bcfg2.Server.Plugin.Plugin): if not hasattr(self, 'static_skn'): self.cache_skn() entry.text = self.static_skn - for hostkey in [keytmpl % client for keytmpl in self.pubkeys \ - if self.repository.entries.has_key(keytmpl % client)]: + hostkeys = [keytmpl % client for keytmpl in self.pubkeys \ + if self.repository.entries.has_key(keytmpl % client)] + hostkeys.sort() + for hostkey in hostkeys: entry.text += "localhost,localhost.localdomain,127.0.0.1 %s" % ( self.repository.entries[hostkey].data) permdata = {'owner':'root', 'group':'root', 'perms':'0644'} -- cgit v1.2.3-1-g7c22