diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2016-07-27 14:55:26 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-07-27 14:50:35 +0900 |
commit | 882262d86158f92d161f1dd92e641d18e64a1b68 (patch) | |
tree | 4e3d6aa3f5ca4388d04d3c7f9ade3df926593eb7 | |
parent | 3c0bd5b024eacf60d2a77b40608db7e81d110a32 (diff) |
manager: Except KeyboardInterrupt to suppress traceback
Currently, ryu-manager emits traceback messages when killed via
KeyboardInterrupt.
This patch traps the KeyboardInterrupt, and outputs an appropriate
log message instead.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: Alan Fordyce <alan_fordyce@keysight.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rwxr-xr-x | ryu/cmd/manager.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ryu/cmd/manager.py b/ryu/cmd/manager.py index b1ce8da2..1e1a6b41 100755 --- a/ryu/cmd/manager.py +++ b/ryu/cmd/manager.py @@ -66,11 +66,11 @@ def main(args=None, prog=None): project='ryu', version='ryu-manager %s' % version) log.init_log() + logger = logging.getLogger(__name__) if CONF.enable_debugger: - LOG = logging.getLogger('ryu.cmd.manager') msg = 'debugging is available (--enable-debugger option is turned on)' - LOG.info(msg) + logger.info(msg) else: hub.patch(thread=True) @@ -80,7 +80,7 @@ def main(args=None, prog=None): pid_file.write(str(os.getpid())) app_lists = CONF.app_lists + CONF.app - # keep old behaivor, run ofp if no application is specified. + # keep old behavior, run ofp if no application is specified. if not app_lists: app_lists = ['ryu.controller.ofp_handler'] @@ -97,6 +97,9 @@ def main(args=None, prog=None): try: hub.joinall(services) + except KeyboardInterrupt: + logger.debug("Keyboard Interrupt received. " + "Closing RYU application manager...") finally: app_mgr.close() |