diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-08-17 20:41:04 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-08-17 20:41:04 +0000 |
commit | 286fae75648b2820f37d40a4a98d9c81093f64b6 (patch) | |
tree | ca092044f81645c85d2f456ff25a26451d78b8a3 /src/lib | |
parent | b2bc07ad7250e01ea64ee5e6fd39dab65ab28c74 (diff) | |
download | bcfg2-286fae75648b2820f37d40a4a98d9c81093f64b6.tar.gz bcfg2-286fae75648b2820f37d40a4a98d9c81093f64b6.tar.bz2 bcfg2-286fae75648b2820f37d40a4a98d9c81093f64b6.zip |
Rick's deterministic ordering patch
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2071 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Plugins/SSHbase.py | 10 |
1 files 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'} |