Search code examples
pythonopen-sourcecommand-line-arguments

Passing own arguments to ryu proxy app


I am developing ryu app. The app is basically a python script. The ryu apps are invoked by ryu-manager like this

ryu-manager {filename}

There are certain parameters that are taken by ryu-manager. I want to know if there is a way i could pass arguments to my file?

argparse module of python to parse command line options is there but am not sure it will work as all arguments I provide are used by ryu-manager not my script.

Any help would be appreciated.


Solution

  • I haven't tried this, but:

    "Ryu currently uses oslo.config.cfg for command-line parsing. (ryu/contrib/oslo/config). There are several examples in the tree. ryu/app/tunnel_port_updater.py"

    from http://comments.gmane.org/gmane.network.ryu.devel/2709

    see also https://github.com/osrg/ryu/blob/master/ryu/app/tunnel_port_updater.py

    The Ryu 'getting started' page simply suggests:

    ryu-manager [--flagfile <path to configuration file>] [generic/application specific options…]

    http://www.osrg.net/ryu/_sources/getting_started.txt