summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/services/protocols/bgp/operator/ssh.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/ryu/services/protocols/bgp/operator/ssh.py b/ryu/services/protocols/bgp/operator/ssh.py
index c228a899..cb2f63b4 100644
--- a/ryu/services/protocols/bgp/operator/ssh.py
+++ b/ryu/services/protocols/bgp/operator/ssh.py
@@ -96,6 +96,16 @@ class SshServer(paramiko.ServerInterface):
super(SshServer, self).__init__()
self.sock = sock
self.addr = addr
+ self.is_connected = True
+
+ # For pylint
+ self.buf = None
+ self.chan = None
+ self.curpos = None
+ self.histindex = None
+ self.history = None
+ self.prompted = None
+ self.promptlen = None
# tweak InternalApi and RootCmd for non-bgp related commands
self.api = InternalApi(log_handler=logging.StreamHandler(sys.stderr))
@@ -110,17 +120,6 @@ class SshServer(paramiko.ServerInterface):
self.transport.add_server_key(host_key)
self.transport.start_server(server=self)
- self.is_connected = True
-
- # For pylint
- self.buf = None
- self.chan = None
- self.curpos = None
- self.histindex = None
- self.history = None
- self.prompted = None
- self.promptlen = None
-
def check_auth_none(self, username):
return paramiko.AUTH_SUCCESSFUL
@@ -260,7 +259,8 @@ class SshServer(paramiko.ServerInterface):
self.curpos = curpos
self._movcursor(curpos)
- def _startnewline(self, prompt=None, buf=''):
+ def _startnewline(self, prompt=None, buf=None):
+ buf = buf or []
if not prompt and self.prompted:
prompt = self.PROMPT
if isinstance(buf, str):