~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ssh.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-30 14:37:31 UTC
  • mfrom: (1711.9.11 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060830143731-af84f2be15714815
(Robey Pointer) replace foo.has_key(bar) with bar in foo

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
        server_key = t.get_remote_server_key()
196
196
        server_key_hex = paramiko.util.hexify(server_key.get_fingerprint())
197
197
        keytype = server_key.get_name()
198
 
        if SYSTEM_HOSTKEYS.has_key(host) and SYSTEM_HOSTKEYS[host].has_key(keytype):
 
198
        if host in SYSTEM_HOSTKEYS and keytype in SYSTEM_HOSTKEYS[host]:
199
199
            our_server_key = SYSTEM_HOSTKEYS[host][keytype]
200
200
            our_server_key_hex = paramiko.util.hexify(our_server_key.get_fingerprint())
201
 
        elif BZR_HOSTKEYS.has_key(host) and BZR_HOSTKEYS[host].has_key(keytype):
 
201
        elif host in BZR_HOSTKEYS and keytype in BZR_HOSTKEYS[host]:
202
202
            our_server_key = BZR_HOSTKEYS[host][keytype]
203
203
            our_server_key_hex = paramiko.util.hexify(our_server_key.get_fingerprint())
204
204
        else:
205
205
            warning('Adding %s host key for %s: %s' % (keytype, host, server_key_hex))
206
 
            if not BZR_HOSTKEYS.has_key(host):
 
206
            if host not in BZR_HOSTKEYS:
207
207
                BZR_HOSTKEYS[host] = {}
208
208
            BZR_HOSTKEYS[host][keytype] = server_key
209
209
            our_server_key = server_key