fix a few bugs found by pycheck
This commit is contained in:
parent
8843feb633
commit
6f4110a066
|
@ -838,7 +838,8 @@ class Channel (object):
|
|||
self._log(ERROR, 'unknown extended_data type %d; discarding' % code)
|
||||
return
|
||||
if self.combine_stderr:
|
||||
return self._feed(s)
|
||||
self._feed(s)
|
||||
else:
|
||||
self.in_stderr_buffer.feed(s)
|
||||
|
||||
def _window_adjust(self, m):
|
||||
|
|
|
@ -28,7 +28,7 @@ from paramiko.common import *
|
|||
from paramiko.dsskey import DSSKey
|
||||
from paramiko.hostkeys import HostKeys
|
||||
from paramiko.rsakey import RSAKey
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from paramiko.ssh_exception import SSHException, BadHostKeyException
|
||||
from paramiko.transport import Transport
|
||||
from paramiko.util import hexify
|
||||
|
||||
|
@ -107,6 +107,7 @@ class SSHClient (object):
|
|||
self._host_keys_filename = None
|
||||
self._log_channel = None
|
||||
self._policy = RejectPolicy()
|
||||
self._transport = None
|
||||
|
||||
def load_system_host_keys(self, filename=None):
|
||||
"""
|
||||
|
@ -378,7 +379,7 @@ class SSHClient (object):
|
|||
filename = os.path.expanduser('~/.ssh/' + filename)
|
||||
try:
|
||||
key = pkey_class.from_private_key_file(filename, password)
|
||||
self._log(DEBUG, 'Trying discovered key %s in %s' % (hexify(key.get_fingerprint(), filename)))
|
||||
self._log(DEBUG, 'Trying discovered key %s in %s' % (hexify(key.get_fingerprint()), filename))
|
||||
self._transport.auth_publickey(username, key)
|
||||
return
|
||||
except SSHException, e:
|
||||
|
|
|
@ -22,6 +22,7 @@ L{SFTPFile}
|
|||
|
||||
import socket
|
||||
import threading
|
||||
import time
|
||||
from paramiko.common import *
|
||||
from paramiko.sftp import *
|
||||
from paramiko.file import BufferedFile
|
||||
|
|
|
@ -62,7 +62,7 @@ class BadAuthenticationType (AuthenticationException):
|
|||
allowed_types = []
|
||||
|
||||
def __init__(self, explanation, types):
|
||||
SSHException.__init__(self, explanation)
|
||||
AuthenticationException.__init__(self, explanation)
|
||||
self.allowed_types = types
|
||||
|
||||
def __str__(self):
|
||||
|
@ -76,7 +76,7 @@ class PartialAuthentication (AuthenticationException):
|
|||
allowed_types = []
|
||||
|
||||
def __init__(self, types):
|
||||
SSHException.__init__(self, 'partial authentication')
|
||||
AuthenticationException.__init__(self, 'partial authentication')
|
||||
self.allowed_types = types
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue