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 <[email protected]> Signed-off-by: Alan Fordyce <[email protected]> Signed-off-by: IWASE Yusuke <[email protected]> --- ryu/cmd/manager.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ryu/cmd/manager.py b/ryu/cmd/manager.py index b1ce8da..1e1a6b4 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() -- 2.7.4 ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
