ovn-detrace is a very useful tool for debugging OVN issues.
It's core logic (mapping openflow cookies / ports with OVN objects) can
be used for a variety of troubleshooting tools. Therefore, it would be
desirable to make use of such logic from an external python program.
This could be done by creating a python library (similarly to what ovs
provides) that is built and pushed to PyPi for other projects to
consume.
However, being the only python script that lives in OVN, this might be a
bit of an overkill, so what this series proposes is an intermediate step
that does not require that much extra maintenance and still alleviates
the main obstacles one finds when trying to use ovn-detrace as a python
module which are:
- python expects module names to end in .py and use underscores instead
of hyphens
- internally, ovn-detrace prints directy to stdout, the output of the
ovn-detrace information should be configurable
- the version information is not easily available
With this series, ovn-detrace is renamed to ovn_detrace.py and a
symlink with the old name is created for backwards compatibility. As a
result, a use can point her PYTHONPATH to ovn's installation path,
run "import ovn_detrace", and make use of ovn-detrace's logic with, say,
individual openflow cookies instead of ofproto/trace outputs.
rfc->v1:
- Fix typos and comments from Timothy Redaelli
- Add ovn_detrace.py to .gitignore
Adrian Moreno (5):
manpages.mk: fix dependencies path
ovn-detrace: use configurable printer object
ovn-detrace: rename ovn-detrace to ovn_detrace.py
ovn-detrace: expose version as global variable
ovn_detrace.py: add helper to create CookieHandlers
Makefile.am | 2 +-
build-aux/sodepends.py | 45 +++-
debian/ovn-common.install | 2 +-
debian/ovn-common.postinst | 1 +
debian/ovn-common.postrm | 1 +
manpages.mk | 12 +-
rhel/ovn-fedora.spec.in | 3 +
utilities/.gitignore | 2 +-
utilities/automake.mk | 14 +-
.../{ovn-detrace.in => ovn_detrace.py.in} | 196 ++++++++++--------
10 files changed, 175 insertions(+), 103 deletions(-)
rename utilities/{ovn-detrace.in => ovn_detrace.py.in} (75%)
--
2.31.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev