[ovs-dev] [unixctl_py 4/6] python: New method to retrieve OVS version at runtime.

Ethan Jackson ethan at nicira.com
Fri Mar 2 00:30:36 UTC 2012


Version information is typically fairly useful when debugging Open
vSwitch.  This patch adds a new version.py module which python code
can use to report its version to callers.

Signed-off-by: Ethan Jackson <ethan at nicira.com>
---
 python/automake.mk    |    7 +++++++
 python/ovs/.gitignore |    1 +
 2 files changed, 8 insertions(+)
 create mode 100644 python/ovs/.gitignore

diff --git a/python/automake.mk b/python/automake.mk
index d63eb4d..b475896 100644
--- a/python/automake.mk
+++ b/python/automake.mk
@@ -28,6 +28,7 @@ ovs_pyfiles = \
 	python/ovs/socket_util.py \
 	python/ovs/stream.py \
 	python/ovs/timeval.py \
+	python/ovs/version.py \
 	python/ovs/vlog.py \
 	python/ovs/util.py
 PYFILES = $(ovs_pyfiles) python/ovs/dirs.py $(ovstest_pyfiles)
@@ -56,3 +57,9 @@ install-data-local: ovs-install-data-local
 UNINSTALL_LOCAL += ovs-uninstall-local
 ovs-uninstall-local:
 	rm -f $(DESTDIR)$(pkgdatadir)/python/ovs/dirs.py
+
+ALL_LOCAL += $(srcdir)/python/ovs/version.py
+$(srcdir)/python/ovs/version.py: config.status
+	$(ro_shell) > $@
+	echo 'VERSION = "$(VERSION)"' >> $@
+	echo 'BUILDNR = "$(BUILDNR)"' >> $@
diff --git a/python/ovs/.gitignore b/python/ovs/.gitignore
new file mode 100644
index 0000000..9852786
--- /dev/null
+++ b/python/ovs/.gitignore
@@ -0,0 +1 @@
+version.py
-- 
1.7.9.2




More information about the dev mailing list