Hi Victor,
Thank you for reviewing my patch.
On 2016年07月21日 11:32, Victor Orlikowski wrote:
Looks good to me, but I have not run it. ;)
A couple of questions/comments:
1) I presume you have verified that all uses of "LOG" have been changed to
"logger"?
Given the scoping, It appears you should have gotten them all.
Yes, I checked them all in main() function scope.
FYI, The reason why I renamed "LOG" to "logger" is just PEP-8 naming
conventions.
N806 variable in function should be lowercase
But, I don't have strong will, so we could keep "LOG", I think.
2) I would re-write the commit message thus:
Currently, ryu-manager emits traceback messages when killed via
KeyboardInterrupt. This patch traps the KeyboardInterrupt, and outputs an
appropriate log message instead.
Thanks, I re-wrote the commit message in v2 patch.
Thanks,
Iwase
Best,
Victor
--
Victor J. Orlikowski <> vjo@[cs.]duke.edu <http://duke.edu>
On Jul 21, 2016, at 2:59 AM, Iwase Yusuke <iwase.yusu...@gmail.com
<mailto:iwase.yusu...@gmail.com>> wrote:
Then, would you review my attached patch?
------------------------------------------------------------------------------
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel
>From e994ae916dea17b7e4345801831be5c71304dc8f Mon Sep 17 00:00:00 2001
From: IWASE Yusuke <iwase.yusu...@gmail.com>
Date: Thu, 21 Jul 2016 10:22:34 +0900
Subject: [PATCH v2] 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 <v...@duke.edu>
Signed-off-by: Alan Fordyce <alan_ford...@keysight.com>
Signed-off-by: IWASE Yusuke <iwase.yusu...@gmail.com>
---
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel