I've added custom settings as described in
http://www.grotto-networking.com/SDNfun.html#doing-more-with-ryu-an-outline-application
:
from ryu.cmd import manager
from ryu import cfg
class MyApp(app_manager.RyuApp):
# ...
if __name__ == "__main__":
cfg.CONF.register_cli_opts([
cfg.StrOpt('config', default='forwarder_config.yaml',
help='Custom Forwarder configuration file ' \
'(default: $PWD/forwarder_config.yaml)')
], group='l7')
manager.main(args=sys.argv)
пт, 16 сент. 2016 г. в 12:16, Nick Sedelnikov <[email protected]>:
> Hi,
>
> Thank you for reply, but both methods lead to sources rewriting and app
> will break on ryu updates, so for now I wrote config loader and hard-coded
> locations, where it can be placed.
>
> Nick
>
> чт, 15 сент. 2016 г. в 11:00, Shinpei Muraoka <[email protected]>:
>
>> Hi,
>>
>> Ryu config must be set when ryu-manager to start.
>> Please try following either method.
>>
>> - Add config to ryu/ryu/flags.py
>> - Include your app to ryu/ryu/cmd/manager.py
>>
>> Thanks,
>>
>> On 2016年09月14日 23:38, Nick Sedelnikov wrote:
>> > Hello all,
>> >
>> > I'm trying to add configuration flags for my ryu application.
>> > I've copied some code from topology.switches to my app:
>> >
>> > from ryu import cfg
>> >
>> > CONF = cfg.CONF
>> > CONF.register_cli_opts([
>> > cfg.StrOpt('l7-config', default='', help='Forwarder config file.'),
>> > ])
>> >
>> > but when I try to run `ryu-manager myapp` Exception appears:
>> >>> oslo_config.cfg.ArgsAlreadyParsedError: arguments already parsed:
>> > cannot register CLI option
>> >
>> > Can anyone help me?
>> >
>> > Nick
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> >
>> >
>> >
>> > _______________________________________________
>> > Ryu-devel mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
>> >
>>
>
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel