diff mbox

[ovs-dev,v3] ovs-bugtool: Create OVN plugin and add output.

Message ID 1453396130-32134-2-git-send-email-u9012063@gmail.com
State Changes Requested
Headers show

Commit Message

William Tu Jan. 21, 2016, 5:08 p.m. UTC
Create a new ovn/utilities/bugtool directory, add ovn.xml to bugtool
plugins, and add ovn-nbctl show, ovn-sbctl show, and ovn-sbctl
lflow-list.

Signed-off-by: William Tu <u9012063@gmail.com>
---
 ovn/utilities/automake.mk                          |  2 ++
 ovn/utilities/bugtool/automake.mk                  |  9 +++++++++
 ovn/utilities/bugtool/ovn-bugtool-nbctl-show       | 19 ++++++++++++++++++
 ovn/utilities/bugtool/ovn-bugtool-sbctl-lflow-list | 19 ++++++++++++++++++
 ovn/utilities/bugtool/ovn-bugtool-sbctl-show       | 19 ++++++++++++++++++
 .../bugtool/plugins/network-status/ovn.xml         | 23 ++++++++++++++++++++++
 utilities/bugtool/automake.mk                      |  6 ++++--
 7 files changed, 95 insertions(+), 2 deletions(-)
 create mode 100644 ovn/utilities/bugtool/automake.mk
 create mode 100644 ovn/utilities/bugtool/ovn-bugtool-nbctl-show
 create mode 100644 ovn/utilities/bugtool/ovn-bugtool-sbctl-lflow-list
 create mode 100644 ovn/utilities/bugtool/ovn-bugtool-sbctl-show
 create mode 100644 ovn/utilities/bugtool/plugins/network-status/ovn.xml

Comments

Ben Pfaff Feb. 5, 2016, 11:54 p.m. UTC | #1
On Thu, Jan 21, 2016 at 09:08:50AM -0800, William Tu wrote:
> Create a new ovn/utilities/bugtool directory, add ovn.xml to bugtool
> plugins, and add ovn-nbctl show, ovn-sbctl show, and ovn-sbctl
> lflow-list.
> 
> Signed-off-by: William Tu <u9012063@gmail.com>

The script names in the .xml file don't match the actual names of the
installed scripts, e.g. one script is installed as
ovn-bugtool-sbctl-show but the .xml file mentions
ovs-bugtool-ovn-sbctl-show.
William Tu Feb. 6, 2016, 4:05 a.m. UTC | #2
Thank you for finding this mistake. I've fixed it and resubmitted.

On Fri, Feb 5, 2016 at 3:54 PM, Ben Pfaff <blp@ovn.org> wrote:

> On Thu, Jan 21, 2016 at 09:08:50AM -0800, William Tu wrote:
> > Create a new ovn/utilities/bugtool directory, add ovn.xml to bugtool
> > plugins, and add ovn-nbctl show, ovn-sbctl show, and ovn-sbctl
> > lflow-list.
> >
> > Signed-off-by: William Tu <u9012063@gmail.com>
>
> The script names in the .xml file don't match the actual names of the
> installed scripts, e.g. one script is installed as
> ovn-bugtool-sbctl-show but the .xml file mentions
> ovs-bugtool-ovn-sbctl-show.
>
diff mbox

Patch

diff --git a/ovn/utilities/automake.mk b/ovn/utilities/automake.mk
index afeb38f..d84368c 100644
--- a/ovn/utilities/automake.mk
+++ b/ovn/utilities/automake.mk
@@ -34,3 +34,5 @@  ovn_utilities_ovn_nbctl_LDADD = ovn/lib/libovn.la ovsdb/libovsdb.la lib/libopenv
 bin_PROGRAMS += ovn/utilities/ovn-sbctl
 ovn_utilities_ovn_sbctl_SOURCES = ovn/utilities/ovn-sbctl.c
 ovn_utilities_ovn_sbctl_LDADD = ovn/lib/libovn.la ovsdb/libovsdb.la lib/libopenvswitch.la
+
+include ovn/utilities/bugtool/automake.mk
diff --git a/ovn/utilities/bugtool/automake.mk b/ovn/utilities/bugtool/automake.mk
new file mode 100644
index 0000000..f6121fc
--- /dev/null
+++ b/ovn/utilities/bugtool/automake.mk
@@ -0,0 +1,9 @@ 
+if HAVE_PYTHON
+bugtool_plugins += \
+	ovn/utilities/bugtool/plugins/network-status/ovn.xml
+
+bugtool_scripts += \
+	ovn/utilities/bugtool/ovn-bugtool-nbctl-show \
+	ovn/utilities/bugtool/ovn-bugtool-sbctl-show \
+	ovn/utilities/bugtool/ovn-bugtool-sbctl-lflow-list
+endif
diff --git a/ovn/utilities/bugtool/ovn-bugtool-nbctl-show b/ovn/utilities/bugtool/ovn-bugtool-nbctl-show
new file mode 100644
index 0000000..9272527
--- /dev/null
+++ b/ovn/utilities/bugtool/ovn-bugtool-nbctl-show
@@ -0,0 +1,19 @@ 
+#! /bin/sh
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of version 2.1 of the GNU Lesser General
+# Public License as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+# Copyright (C) 2016 Nicira, Inc.
+
+ovn-nbctl --timeout=3 show
diff --git a/ovn/utilities/bugtool/ovn-bugtool-sbctl-lflow-list b/ovn/utilities/bugtool/ovn-bugtool-sbctl-lflow-list
new file mode 100644
index 0000000..33a15d7
--- /dev/null
+++ b/ovn/utilities/bugtool/ovn-bugtool-sbctl-lflow-list
@@ -0,0 +1,19 @@ 
+#! /bin/sh
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of version 2.1 of the GNU Lesser General
+# Public License as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+# Copyright (C) 2016 Nicira, Inc.
+
+ovn-sbctl --timeout=3 lflow-list
diff --git a/ovn/utilities/bugtool/ovn-bugtool-sbctl-show b/ovn/utilities/bugtool/ovn-bugtool-sbctl-show
new file mode 100644
index 0000000..b6741bc
--- /dev/null
+++ b/ovn/utilities/bugtool/ovn-bugtool-sbctl-show
@@ -0,0 +1,19 @@ 
+#! /bin/sh
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of version 2.1 of the GNU Lesser General
+# Public License as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+# Copyright (C) 2016 Nicira, Inc.
+
+ovn-sbctl --timeout=3 show
diff --git a/ovn/utilities/bugtool/plugins/network-status/ovn.xml b/ovn/utilities/bugtool/plugins/network-status/ovn.xml
new file mode 100644
index 0000000..59d2d6b
--- /dev/null
+++ b/ovn/utilities/bugtool/plugins/network-status/ovn.xml
@@ -0,0 +1,23 @@ 
+<!--
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of version 2.1 of the GNU Lesser General Public
+ License as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ USA.
+
+ Copyright (C) 2016 Nicira, Inc.
+-->
+
+<collect>
+  <command label="ovn-nbctl-show" filters="ovn">/usr/share/openvswitch/scripts/ovs-bugtool-ovn-nbctl-show</command>
+  <command label="ovn-sbctl-show" filters="ovn">/usr/share/openvswitch/scripts/ovs-bugtool-ovn-sbctl-show</command>
+  <command label="ovn-sbctl-lflow-list" filters="ovn">/usr/share/openvswitch/scripts/ovs-bugtool-ovn-sbctl-lflow-list</command>
+</collect>
diff --git a/utilities/bugtool/automake.mk b/utilities/bugtool/automake.mk
index b11cf1a..b795fb3 100644
--- a/utilities/bugtool/automake.mk
+++ b/utilities/bugtool/automake.mk
@@ -37,7 +37,8 @@  bugtoolpluginsdir = $(pkgdatadir)/bugtool-plugins
 INSTALL_DATA_LOCAL += bugtool-install-data-local
 bugtool-install-data-local:
 	for plugin in $(bugtool_plugins); do \
-	  stem=`echo "$$plugin" | sed 's,utilities/bugtool/plugins/,,'`; \
+	  stem=`echo "$$plugin" | sed 's,ovn/,,'`; \
+	  stem=`echo "$$stem" | sed 's,utilities/bugtool/plugins/,,'`; \
 	  dir=`expr "$$stem" : '\(.*\)/[^/]*$$'`; \
 	  $(MKDIR_P) "$(DESTDIR)$(bugtoolpluginsdir)/$$dir"; \
 	  $(INSTALL_DATA) "$(srcdir)/$$plugin" "$(DESTDIR)$(bugtoolpluginsdir)/$$stem"; \
@@ -46,7 +47,8 @@  bugtool-install-data-local:
 UNINSTALL_LOCAL += bugtool-uninstall-local
 bugtool-uninstall-local:
 	for plugin in $(bugtool_plugins); do \
-	  stem=`echo "$$plugin" | sed 's,utilities/bugtool/plugins/,,'`; \
+	  stem=`echo "$$plugin" | sed 's,ovn/,,'`; \
+	  stem=`echo "$$stem" | sed 's,utilities/bugtool/plugins/,,'`; \
 	  rm -f "$(DESTDIR)$(bugtoolpluginsdir)/$$stem"; \
 	done
 	for plugin in $(bugtool_plugins); do \