~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Robey Pointer
  • Date: 2006-08-29 20:47:02 UTC
  • mto: (1711.9.9 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1975.
  • Revision ID: robey@lag.net-20060829204702-6d40ae7a33ec62c7
remove usage of has_key()

Show diffs side-by-side

added added

removed removed

Lines of Context:
871
871
        server_key = t.get_remote_server_key()
872
872
        server_key_hex = paramiko.util.hexify(server_key.get_fingerprint())
873
873
        keytype = server_key.get_name()
874
 
        if SYSTEM_HOSTKEYS.has_key(self._host) and SYSTEM_HOSTKEYS[self._host].has_key(keytype):
 
874
        if (self._host in SYSTEM_HOSTKEYS) and (keytype in SYSTEM_HOSTKEYS[self._host]):
875
875
            our_server_key = SYSTEM_HOSTKEYS[self._host][keytype]
876
876
            our_server_key_hex = paramiko.util.hexify(our_server_key.get_fingerprint())
877
 
        elif BZR_HOSTKEYS.has_key(self._host) and BZR_HOSTKEYS[self._host].has_key(keytype):
 
877
        elif (self._host in BZR_HOSTKEYS) and (keytype in BZR_HOSTKEYS[self._host]):
878
878
            our_server_key = BZR_HOSTKEYS[self._host][keytype]
879
879
            our_server_key_hex = paramiko.util.hexify(our_server_key.get_fingerprint())
880
880
        else:
881
881
            warning('Adding %s host key for %s: %s' % (keytype, self._host, server_key_hex))
882
 
            if not BZR_HOSTKEYS.has_key(self._host):
 
882
            if self._host not in BZR_HOSTKEYS:
883
883
                BZR_HOSTKEYS[self._host] = {}
884
884
            BZR_HOSTKEYS[self._host][keytype] = server_key
885
885
            our_server_key = server_key