2013/3/14 YAMAMOTO Takashi <yamam...@valinux.co.jp>: >> On Wed, Mar 13, 2013 at 02:48:03PM +0900, Kei Ohmura wrote: >>> 2013/3/6 Isaku Yamahata <yamah...@valinux.co.jp>: >>> > On Wed, Mar 06, 2013 at 11:54:00AM +0900, OHMURA Kei wrote: >>> >> This gets a netflow packet and sends it to the other >>> >> applications. Each application can use this to get netflow >>> >> messages as an event. >>> >> >>> >> Signed-off-by: OHMURA Kei <ohmura....@lab.ntt.co.jp> >>> >> --- >>> >> ryu/flags.py | 8 +++++- >>> >> ryu/lib/xflow/netflow_collector.py | 54 >>> >> ++++++++++++++++++++++++++++++++++++ >>> >> 2 files changed, 61 insertions(+), 1 deletion(-) >>> >> create mode 100644 ryu/lib/xflow/netflow_collector.py >>> >> >>> >> diff --git a/ryu/flags.py b/ryu/flags.py >>> >> index 533f7de..4a0a2d7 100644 >>> >> --- a/ryu/flags.py >>> >> +++ b/ryu/flags.py >>> >> @@ -40,5 +40,11 @@ CONF.register_cli_opts([ >>> >> 'context'), >>> >> cfg.StrOpt('quantum-controller-addr', default=None, >>> >> help='openflow method:address:port to set controller of' >>> >> - 'ovs bridge') >>> >> + 'ovs bridge'), >>> >> + >>> >> + # lib/xflow/netflow_collector >>> >> + cfg.StrOpt('netflow-listen-host', default='', >>> >> + help='netflow listen host'), >>> >> + cfg.IntOpt('netflow-listen-port', default=2055, >>> >> + help='netflow listen port') >>> >> ]) >>> > >>> > Now this can be in ryu/lib/xflow/netflow_collector.py. >>> > openstack-derived cfg is capable of reevaluating options when loading >>> > module. >>> >>> Don't we have to define these flags before calling CONF() in >>> bin/ryu-manager when running ryu-manager with these flags? > > if they need to be cli options, yes. > >> >> No. When CONF() is called after ryu-manager initialization, >> cfg module re-evaluate it. That's the point. > > i guess you are mixing CONF() and CONF.__getattr__(). > > the former is called on ryu-manager startup and handles > --help etc. cli options should be registered before this.
Now I understand. Thanks. > > the latter is called when you accesses CONF.your_option. > non-cli options should be registered before this. > > YAMAMOTO Takashi > ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel