summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/services/protocols/bgp/operator/ssh.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ryu/services/protocols/bgp/operator/ssh.py b/ryu/services/protocols/bgp/operator/ssh.py
index 5690f674..c4f4ca50 100644
--- a/ryu/services/protocols/bgp/operator/ssh.py
+++ b/ryu/services/protocols/bgp/operator/ssh.py
@@ -22,6 +22,7 @@ from copy import copy
import logging
import os.path
import sys
+import traceback
import paramiko
@@ -30,6 +31,7 @@ from ryu.lib import hub
from ryu.services.protocols.bgp.base import Activity
from ryu.services.protocols.bgp.operator.command import Command
from ryu.services.protocols.bgp.operator.command import CommandsResponse
+from ryu.services.protocols.bgp.operator.command import STATUS_ERROR
from ryu.services.protocols.bgp.operator.command import STATUS_OK
from ryu.services.protocols.bgp.operator.commands.root import RootCmd
from ryu.services.protocols.bgp.operator.internal_api import InternalApi
@@ -350,7 +352,12 @@ class SshServer(paramiko.ServerInterface):
return ret
def _execute_cmd(self, cmds):
- result, _ = self.root(cmds)
+ try:
+ result, _ = self.root(cmds)
+ except:
+ tb = traceback.format_exc()
+ LOG.error(tb)
+ result = CommandsResponse(STATUS_ERROR, 'Internal error')
LOG.debug("result: %s", result)
if cmds[0] == 'quit':
self.is_connected = False