diff --git a/ryu/cmd/manager.py b/ryu/cmd/manager.py index cdcc7ae9..66d59b3b 100755 --- a/ryu/cmd/manager.py +++ b/ryu/cmd/manager.py @@ -17,7 +17,7 @@ # limitations under the License. from ryu.lib import hub -hub.patch() +hub.patch(thread=False) # TODO: # Right now, we have our own patched copy of ovs python bindings @@ -50,6 +50,9 @@ CONF.register_cli_opts([ cfg.MultiStrOpt('app', positional=True, default=[], help='application module name to run'), cfg.StrOpt('pid-file', default=None, help='pid file name'), + cfg.BoolOpt('enable-debugger', default=False, + help='don\'t overwrite Python standard threading library' + '(use only for debugging)'), ]) @@ -64,6 +67,13 @@ def main(args=None, prog=None): log.init_log() + if CONF.enable_debugger: + LOG = logging.getLogger('ryu.cmd.manager') + msg = 'debugging is available (--enable-debugger option is turned on)' + LOG.info(msg) + else: + hub.patch(thread=True) + if CONF.pid_file: import os with open(CONF.pid_file, 'w') as pid_file: