diff options
Diffstat (limited to 'import-layers/meta-virtualization/recipes-networking/openvswitch')
24 files changed, 0 insertions, 2944 deletions
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch deleted file mode 100644 index cb708deae..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch +++ /dev/null @@ -1,68 +0,0 @@ -Add test-install rule to support ptest execution - -Signed-off-by: Radu Patriu <radu.patriu@enea.com> - -Index: openvswitch-2.1.2/Makefile.am -=================================================================== ---- openvswitch-2.1.2.orig/Makefile.am -+++ openvswitch-2.1.2/Makefile.am -@@ -300,3 +300,5 @@ - include python/compat/automake.mk - include tutorial/automake.mk - include vtep/automake.mk -+include test.mk -+ -Index: openvswitch-2.1.2/test.mk -=================================================================== ---- /dev/null -+++ openvswitch-2.1.2/test.mk -@@ -0,0 +1,49 @@ -+TEST_DEST ?= ${prefix}/lib/openvswitch -+TEST_ROOT ?= ${prefix}/lib/openvswitch -+TEST_DEPEND = -+ -+if HAVE_OPENSSL -+TEST_DEPEND += $(TESTPKI_FILES) -+endif -+ -+test-install: $(TEST_DEPEND) -+ @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\ -+ install -d $(TEST_DEST)/tests ;\ -+ install -d $(TEST_DEST)/python ;\ -+ install -d $(TEST_DEST)/python/ovs ;\ -+ install -d $(TEST_DEST)/python/ovs/db ;\ -+ install -d $(TEST_DEST)/python/ovs/unixctl ;\ -+ install -d $(TEST_DEST)/vswitchd ;\ -+ install vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\ -+ install -d $(TEST_DEST)/debian ;\ -+ install debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\ -+ install -d $(TEST_DEST)/build-aux ;\ -+ install build-aux/check-structs $(TEST_DEST)/build-aux ;\ -+ install -d $(TEST_DEST)/xenserver ;\ -+ install xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\ -+ install xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\ -+ install xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\ -+ install xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\ -+ install xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\ -+ install -d $(TEST_DEST)/vtep ;\ -+ install vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\ -+ for p in $$list ; do \ -+ echo $$p ;\ -+ p=$${p#./} ;\ -+ pre=$${p#tests\/} ;\ -+ if test $$pre != $$p ; then \ -+ echo installing $$p to $(TEST_DEST)/tests/$$pre ;\ -+ install $$p $(TEST_DEST)/tests/$$pre ;\ -+ continue ;\ -+ fi ;\ -+ pre=$${p#python\/ovs\/} ;\ -+ if test $$pre != $$p ; then \ -+ echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\ -+ install $$p $(TEST_DEST)/python/ovs/$$pre ;\ -+ continue ;\ -+ fi; \ -+ done ;\ -+ sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-example b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-example deleted file mode 100644 index 6f08c3fab..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-example +++ /dev/null @@ -1,102 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2011 Nicira Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -### BEGIN INIT INFO -# Provides: openvswitch-switch -# Required-Start: $network $named $remote_fs $syslog -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Open vSwitch switch -### END INIT INFO - -(test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0 - -. /usr/share/openvswitch/scripts/ovs-lib -test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch - -if test X"$BRCOMPAT" = Xyes && test ! -x /usr/sbin/ovs-brcompatd; then - BRCOMPAT=no - log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility" -fi - -ovs_ctl () { - set /usr/share/openvswitch/scripts/ovs-ctl "$@" - if test X"$BRCOMPAT" = Xyes; then - set "$@" --brcompat - fi - "$@" -} - -load_kmod () { - ovs_ctl load-kmod || exit $? -} - -start () { - if ovs_ctl load-kmod; then - : - else - echo "Module has probably not been built for this kernel." - if ! test -d /usr/share/doc/openvswitch-datapath-source; then - echo "Install the openvswitch-datapath-source package, then read" - else - echo "For instructions, read" - fi - echo "/usr/share/doc/openvswitch-datapath-source/README.Debian" - fi - set ovs_ctl ${1-start} --system-id=random - if test X"$FORCE_COREFILES" != X; then - set "$@" --force-corefiles="$FORCE_COREFILES" - fi - "$@" || exit $? - - ovs_ctl --protocol=gre enable-protocol -} - -stop () { - ovs_ctl stop -} - -case $1 in - start) - start - ;; - stop | force-stop) - stop - ;; - reload | force-reload) - # The OVS daemons keep up-to-date. - ;; - restart) - stop - start - ;; - status) - ovs_ctl status - ;; - force-reload-kmod) - start force-reload-kmod - ;; - load-kmod) - load_kmod - ;; - *) - echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch deleted file mode 100644 index 6f08c3fab..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch +++ /dev/null @@ -1,102 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2011 Nicira Networks, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -### BEGIN INIT INFO -# Provides: openvswitch-switch -# Required-Start: $network $named $remote_fs $syslog -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Open vSwitch switch -### END INIT INFO - -(test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0 - -. /usr/share/openvswitch/scripts/ovs-lib -test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch - -if test X"$BRCOMPAT" = Xyes && test ! -x /usr/sbin/ovs-brcompatd; then - BRCOMPAT=no - log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility" -fi - -ovs_ctl () { - set /usr/share/openvswitch/scripts/ovs-ctl "$@" - if test X"$BRCOMPAT" = Xyes; then - set "$@" --brcompat - fi - "$@" -} - -load_kmod () { - ovs_ctl load-kmod || exit $? -} - -start () { - if ovs_ctl load-kmod; then - : - else - echo "Module has probably not been built for this kernel." - if ! test -d /usr/share/doc/openvswitch-datapath-source; then - echo "Install the openvswitch-datapath-source package, then read" - else - echo "For instructions, read" - fi - echo "/usr/share/doc/openvswitch-datapath-source/README.Debian" - fi - set ovs_ctl ${1-start} --system-id=random - if test X"$FORCE_COREFILES" != X; then - set "$@" --force-corefiles="$FORCE_COREFILES" - fi - "$@" || exit $? - - ovs_ctl --protocol=gre enable-protocol -} - -stop () { - ovs_ctl stop -} - -case $1 in - start) - start - ;; - stop | force-stop) - stop - ;; - reload | force-reload) - # The OVS daemons keep up-to-date. - ;; - restart) - stop - start - ;; - status) - ovs_ctl status - ;; - force-reload-kmod) - start force-reload-kmod - ;; - load-kmod) - load_kmod - ;; - *) - echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch-setup b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch-setup deleted file mode 100644 index 73387fbc1..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch-setup +++ /dev/null @@ -1,8 +0,0 @@ -# This is a POSIX shell fragment -*- sh -*- - -# FORCE_COREFILES: If 'yes' then core files will be enabled. -# FORCE_COREFILES=yes - -# BRCOMPAT: If 'yes' and the openvswitch-brcompat package is installed, then -# Linux bridge compatibility will be enabled. -# BRCOMPAT=yes diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller deleted file mode 100755 index aad5ad60e..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller +++ /dev/null @@ -1,274 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2011 Nicira Networks Inc. -# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org> -# -# This is free software; you may redistribute it and/or modify -# it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2, -# or (at your option) any later version. -# -# This 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License with -# the Debian operating system, in /usr/share/common-licenses/GPL; if -# not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA -# -### BEGIN INIT INFO -# Provides: openvswitch-testcontroller -# Required-Start: $network $local_fs $remote_fs -# Required-Stop: $remote_fs -# Should-Start: $named -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Open vSwitch controller -### END INIT INFO - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -DAEMON=/usr/bin/ovs-testcontroller # Introduce the server's location here -NAME=ovs-testcontroller # Introduce the short server's name here -DESC=ovs-testcontroller # Introduce a short description here -LOGDIR=/var/log/openvswitch # Log directory to use - -PIDFILE=/var/run/openvswitch/$NAME.pid - -test -x $DAEMON || exit 0 - -. /lib/lsb/init-functions - -# Default options, these can be overriden by the information -# at /etc/default/openvswitch-testcontroller -DAEMON_OPTS="" # Additional options given to the server - -DODTIME=10 # Time to wait for the server to die, in seconds - # If this value is set too low you might not - # let some servers to die gracefully and - # 'restart' will not work - -LOGFILE=$LOGDIR/$NAME.log # Server logfile -#DAEMONUSER= # User to run the daemons as. If this value - # is set start-stop-daemon will chuid the server - -# Include defaults if available -default=/etc/default/openvswitch-testcontroller -if [ -f $default ] ; then - . $default -fi - -# Check that the user exists (if we set a user) -# Does the user exist? -if [ -n "$DAEMONUSER" ] ; then - if getent passwd | grep -q "^$DAEMONUSER:"; then - # Obtain the uid and gid - DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` - DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` - else - log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." - exit 1 - fi -fi - - -set -e - -running_pid() { -# Check if a given process pid's cmdline matches a given name - pid=$1 - name=$2 - [ -z "$pid" ] && return 1 - [ ! -d /proc/$pid ] && return 1 - cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` - # Is this the expected server - [ "$cmd" != "$name" ] && return 1 - return 0 -} - -running() { -# Check if the process is running looking at /proc -# (works for all users) - - # No pidfile, probably no daemon present - [ ! -f "$PIDFILE" ] && return 1 - pid=`cat $PIDFILE` - running_pid $pid $DAEMON || return 1 - return 0 -} - -start_server() { - if [ -z "$LISTEN" ]; then - echo "$default: No connection methods configured, controller disabled" >&2 - exit 0 - fi - - if [ ! -d /var/run/openvswitch ]; then - install -d -m 755 -o root -g root /var/run/openvswitch - fi - - SSL_OPTS= - case $LISTEN in - *ssl*) - : ${PRIVKEY:=/etc/openvswitch-testcontroller/privkey.pem} - : ${CERT:=/etc/openvswitch-testcontroller/cert.pem} - : ${CACERT:=/etc/openvswitch-testcontroller/cacert.pem} - if test ! -e "$PRIVKEY" || test ! -e "$CERT" || - test ! -e "$CACERT"; then - if test ! -e "$PRIVKEY"; then - echo "$PRIVKEY: private key missing" >&2 - fi - if test ! -e "$CERT"; then - echo "$CERT: certificate for private key missing" >&2 - fi - if test ! -e "$CACERT"; then - echo "$CACERT: CA certificate missing" >&2 - fi - exit 1 - fi - SSL_OPTS="--private-key=$PRIVKEY --certificate=$CERT --ca-cert=$CACERT" - ;; - esac - -# Start the process using the wrapper - if [ -z "$DAEMONUSER" ] ; then - start-stop-daemon --start --pidfile $PIDFILE \ - --exec $DAEMON -- --detach --pidfile=$PIDFILE \ - $LISTEN $DAEMON_OPTS $SSL_OPTS - errcode=$? - else -# if we are using a daemonuser then change the user id - start-stop-daemon --start --quiet --pidfile $PIDFILE \ - --chuid $DAEMONUSER --exec $DAEMON -- \ - --detach --pidfile=$PIDFILE $LISTEN $DAEMON_OPTS \ - $SSL_OPTS - errcode=$? - fi - return $errcode -} - -stop_server() { -# Stop the process using the wrapper - if [ -z "$DAEMONUSER" ] ; then - start-stop-daemon --stop --quiet --pidfile $PIDFILE \ - --exec $DAEMON - errcode=$? - else -# if we are using a daemonuser then look for process that match - start-stop-daemon --stop --quiet --pidfile $PIDFILE \ - --user $DAEMONUSER --exec $DAEMON - errcode=$? - fi - - return $errcode -} - -reload_server() { - [ ! -f "$PIDFILE" ] && return 1 - pid=`cat $PIDFILE` # This is the daemon's pid - # Send a SIGHUP - kill -1 $pid - return $? -} - -force_stop() { -# Force the process to die killing it manually - [ ! -e "$PIDFILE" ] && return - if running ; then - kill -15 $pid - # Is it really dead? - sleep "$DODTIME" - if running ; then - kill -9 $pid - sleep "$DODTIME" - if running ; then - echo "Cannot kill $NAME (pid=$pid)!" - exit 1 - fi - fi - fi - rm -f $PIDFILE -} - - -case "$1" in - start) - log_begin_msg "Starting $DESC " "$NAME" - # Check if it's running first - if running ; then - log_warning_msg "apparently already running" - log_end_msg 0 - exit 0 - fi - if start_server && running ; then - # It's ok, the server started and is running - log_end_msg 0 - else - # Either we could not start it or it is not running - # after we did - # NOTE: Some servers might die some time after they start, - # this code does not try to detect this and might give - # a false positive (use 'status' for that) - log_end_msg 1 - fi - ;; - stop) - log_begin_msg "Stopping $DESC" "$NAME" - if running ; then - # Only stop the server if we see it running - stop_server - log_end_msg $? - else - # If it's not running don't do anything - log_warning_msg "apparently not running" - log_end_msg 0 - exit 0 - fi - ;; - force-stop) - # First try to stop gracefully the program - $0 stop - if running; then - # If it's still running try to kill it more forcefully - log_begin_msg "Stopping (force) $DESC" "$NAME" - force_stop - log_end_msg $? - fi - ;; - restart|force-reload) - log_begin_msg "Restarting $DESC" "$NAME" - stop_server - # Wait some sensible amount, some server need this - [ -n "$DODTIME" ] && sleep $DODTIME - start_server - running - log_end_msg $? - ;; - status) - - log_begin_msg "Checking status of $DESC" "$NAME" - if running ; then - log_begin_msg "running" - log_end_msg 0 - else - log_warning_msg "apparently not running" - log_end_msg 1 - exit 1 - fi - ;; - # Use this if the daemon cannot reload - reload) - log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" - log_warning_msg "cannot re-read the config file (use restart)." - ;; - *) - N=/etc/init.d/openvswitch-testcontroller - echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller-setup b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller-setup deleted file mode 100644 index b431ece51..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller-setup +++ /dev/null @@ -1,29 +0,0 @@ -# This is a POSIX shell fragment -*- sh -*- - -# LISTEN: What OpenFlow connection methods should the controller listen on? -# -# This is a space-delimited list of connection methods: -# -# * "pssl:[PORT]": Listen for SSL connections on the specified PORT -# (default: 6633). The private key, certificate, and CA certificate -# must be specified below. -# -# * "pctp:[PORT]": Listen for TCP connections on the specified PORT -# (default: 6633). Not recommended for security reasons. -# -LISTEN="pssl:" - -# PRIVKEY: Name of file containing controller's private key. -# Required if SSL enabled. -PRIVKEY=/etc/openvswitch-testcontroller/privkey.pem - -# CERT: Name of file containing certificate for private key. -# Required if SSL enabled. -CERT=/etc/openvswitch-testcontroller/cert.pem - -# CACERT: Name of file containing switch CA certificate. -# Required if SSL enabled. -CACERT=/etc/openvswitch-testcontroller/cacert.pem - -# Additional options to pass to controller, e.g. "--hub" -DAEMON_OPTS="" diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch deleted file mode 100644 index deff10b06..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch +++ /dev/null @@ -1,150 +0,0 @@ -From f21a0490555d5fe8f5a9ce982defa666a64151c0 Mon Sep 17 00:00:00 2001 -From: Mark Asselstine <mark.asselstine@windriver.com> -Date: Fri, 13 Jan 2017 16:12:55 -0500 -Subject: [PATCH] python: make remaining scripts use /usr/bin/env - -Unfortunately there is no concept of a host python vs. target python -to facilitate cross compilation. There is only one PYTHON variable and -this is used during building and in the header of python scripts after -installation. The best approach for cross compilation is to thus to -ensure python is in the path and avoid passing a path as part of -PYTHON. To make this function smoothly all installed scripts should -make use of /usr/bin/env to increase the chances of finding python. - -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> - ---- - build-aux/check-structs | 2 +- - build-aux/extract-ofp-actions | 2 +- - build-aux/extract-ofp-errors | 2 +- - build-aux/extract-ofp-fields | 2 +- - build-aux/extract-ofp-msgs | 2 +- - build-aux/xml2nroff | 2 +- - ovn/utilities/ovn-docker-overlay-driver | 2 +- - ovn/utilities/ovn-docker-underlay-driver | 2 +- - ovsdb/ovsdb-doc | 2 +- - ovsdb/ovsdb-dot.in | 2 +- - ovsdb/ovsdb-idlc.in | 2 +- - utilities/bugtool/ovs-bugtool.in | 2 +- - 12 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/build-aux/check-structs b/build-aux/check-structs -index f79f235..5129b72 100755 ---- a/build-aux/check-structs -+++ b/build-aux/check-structs -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - - import os.path - import sys -diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions -index 0062ab8..ee8c4ff 100755 ---- a/build-aux/extract-ofp-actions -+++ b/build-aux/extract-ofp-actions -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - - import sys - import os.path -diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors -index 2312b76..e36444e 100755 ---- a/build-aux/extract-ofp-errors -+++ b/build-aux/extract-ofp-errors -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - - import sys - import os.path -diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields -index 498b887..c248e76 100755 ---- a/build-aux/extract-ofp-fields -+++ b/build-aux/extract-ofp-fields -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - - import getopt - import sys -diff --git a/build-aux/extract-ofp-msgs b/build-aux/extract-ofp-msgs -index 1813638..c2a91f9 100755 ---- a/build-aux/extract-ofp-msgs -+++ b/build-aux/extract-ofp-msgs -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - - import sys - import os.path -diff --git a/build-aux/xml2nroff b/build-aux/xml2nroff -index bd4e879..db45c56 100755 ---- a/build-aux/xml2nroff -+++ b/build-aux/xml2nroff -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - - # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. - # -diff --git a/ovn/utilities/ovn-docker-overlay-driver b/ovn/utilities/ovn-docker-overlay-driver -index 52de3db..3b1fa45 100755 ---- a/ovn/utilities/ovn-docker-overlay-driver -+++ b/ovn/utilities/ovn-docker-overlay-driver -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - # Copyright (C) 2015 Nicira, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); -diff --git a/ovn/utilities/ovn-docker-underlay-driver b/ovn/utilities/ovn-docker-underlay-driver -index 2c9c4b6..551e7a1 100755 ---- a/ovn/utilities/ovn-docker-underlay-driver -+++ b/ovn/utilities/ovn-docker-underlay-driver -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - # Copyright (C) 2015 Nicira, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); -diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc -index 5cf26ee..bdf2dcc 100755 ---- a/ovsdb/ovsdb-doc -+++ b/ovsdb/ovsdb-doc -@@ -1,4 +1,4 @@ --#! /usr/bin/python -+#! /usr/bin/env python3 - - # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. - # -diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in -index 134ce22..893c408 100755 ---- a/ovsdb/ovsdb-dot.in -+++ b/ovsdb/ovsdb-dot.in -@@ -1,4 +1,4 @@ --#! @PYTHON@ -+#! /usr/bin/env @PYTHON@ - - from datetime import date - import ovs.db.error -diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in -index 721ab50..bfbcf23 100755 ---- a/ovsdb/ovsdb-idlc.in -+++ b/ovsdb/ovsdb-idlc.in -@@ -1,4 +1,4 @@ --#! @PYTHON@ -+#! /usr/bin/env @PYTHON@ - - import getopt - import os -diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in -index 963c50c..c84d7c2 100755 ---- a/utilities/bugtool/ovs-bugtool.in -+++ b/utilities/bugtool/ovs-bugtool.in -@@ -1,4 +1,4 @@ --#! @PYTHON@ -+#! /usr/bin/env @PYTHON@ - - # 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 diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-switch-remaining-scripts-to-use-python3.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-switch-remaining-scripts-to-use-python3.patch deleted file mode 100644 index 6a1b83201..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/python-switch-remaining-scripts-to-use-python3.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 39d1af836d844c89e625cfc908545e93977af8be Mon Sep 17 00:00:00 2001 -From: Mark Asselstine <mark.asselstine@windriver.com> -Date: Wed, 3 May 2017 10:39:12 -0400 -Subject: [PATCH] python: switch remaining scripts to use python3 - -Work to remove the main openvswitch package's dependency on python 2. - -Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> - ---- - ofproto/ipfix-gen-entities | 2 +- - tests/test-l7.py | 2 +- - utilities/checkpatch.py | 2 +- - utilities/ovs-dev.py | 2 +- - utilities/ovs-pipegen.py | 2 +- - vtep/ovs-vtep | 2 +- - xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | 2 +- - xenserver/opt_xensource_libexec_interface-reconfigure | 2 +- - xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | 2 +- - 9 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/ofproto/ipfix-gen-entities b/ofproto/ipfix-gen-entities -index 0be7199..d2cce42 100755 ---- a/ofproto/ipfix-gen-entities -+++ b/ofproto/ipfix-gen-entities -@@ -1,4 +1,4 @@ --#! /usr/bin/env python -+#! /usr/bin/env python3 - # - # Copyright (C) 2012 Nicira, Inc. - # -diff --git a/tests/test-l7.py b/tests/test-l7.py -index d7854a1..f09defb 100755 ---- a/tests/test-l7.py -+++ b/tests/test-l7.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # Copyright (c) 2015, 2016 Nicira, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); -diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py -index 26eb5c3..2e1932b 100755 ---- a/utilities/checkpatch.py -+++ b/utilities/checkpatch.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # Copyright (c) 2016 Red Hat, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); -diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py -index 9ce0f04..839e13e 100755 ---- a/utilities/ovs-dev.py -+++ b/utilities/ovs-dev.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # Copyright (c) 2013, 2014, 2015, 2016 Nicira, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); -diff --git a/utilities/ovs-pipegen.py b/utilities/ovs-pipegen.py -index 4bf240f..2a8f13e 100755 ---- a/utilities/ovs-pipegen.py -+++ b/utilities/ovs-pipegen.py -@@ -1,4 +1,4 @@ --#! /usr/bin/env python -+#! /usr/bin/env python3 - # Copyright (c) 2013, 2014, 2015 Nicira, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); -diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep -index fd652d4..19d63f9 100755 ---- a/vtep/ovs-vtep -+++ b/vtep/ovs-vtep -@@ -1,4 +1,4 @@ --#! /usr/bin/env python -+#! /usr/bin/env python3 - # Copyright (C) 2013 Nicira, Inc. All Rights Reserved. - # - # Licensed under the Apache License, Version 2.0 (the "License"); -diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update -index e7404e3..5edad76 100755 ---- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update -+++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - # xapi plugin script to update the cache of configuration items in the - # ovs-vswitchd configuration that are managed in the xapi database when -diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure -index ea4a742..c6745ee 100755 ---- a/xenserver/opt_xensource_libexec_interface-reconfigure -+++ b/xenserver/opt_xensource_libexec_interface-reconfigure -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # - # Copyright (c) 2008,2009 Citrix Systems, Inc. - # -diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync -index a776c00..d5ff8af 100755 ---- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync -+++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync -@@ -1,4 +1,4 @@ --#! /usr/bin/env python -+#! /usr/bin/env python3 - # Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/run-ptest b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/run-ptest deleted file mode 100644 index dd0670762..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/run-ptest +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./tests/testsuite --am-fmt -C tests AUTOTEST_PATH=utilities:vswitchd:ovsdb:tests - diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0001-Python3-compatibility-Convert-print-statements.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0001-Python3-compatibility-Convert-print-statements.patch deleted file mode 100644 index 7bdcc0034..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0001-Python3-compatibility-Convert-print-statements.patch +++ /dev/null @@ -1,1262 +0,0 @@ -From 3658d861c3c83caab9040bec04b195be3f86d4ce Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Thu, 29 Jun 2017 20:33:23 -0700 -Subject: [PATCH] Python3 compatibility: Convert print statements - -Commit d34a1cc02536f9a812517a71accec3fbd3c6c98b from -https://github.com/openvswitch/ovs.git - -This patch fixes up all the print statements to work with python3 or -python2. - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Ben Pfaff <blp@ovn.org> - ---- - build-aux/check-structs | 4 +- - build-aux/extract-ofp-actions | 68 +++--- - build-aux/extract-ofp-errors | 2 +- - build-aux/extract-ofp-fields | 2 +- - build-aux/extract-ofp-msgs | 6 +- - ovsdb/ovsdb-doc | 6 +- - ovsdb/ovsdb-idlc.in | 523 +++++++++++++++++++++--------------------- - 7 files changed, 306 insertions(+), 305 deletions(-) - -diff --git a/build-aux/check-structs b/build-aux/check-structs -index 5129b72..cbb19b6 100755 ---- a/build-aux/check-structs -+++ b/build-aux/check-structs -@@ -211,7 +211,7 @@ def checkStructs(): - - if '--help' in sys.argv: - argv0 = os.path.basename(sys.argv[0]) -- print '''\ -+ print('''\ - %(argv0)s, for checking struct and struct member alignment - usage: %(argv0)s -Ipath HEADER [HEADER]... - -@@ -226,7 +226,7 @@ assertions using OFP_ASSERT. - - This program is specialized for reading Open vSwitch's OpenFlow header - files. It will not work on arbitrary header files without extensions.\ --''' % {"argv0": argv0} -+''' % {"argv0": argv0}) - sys.exit(0) - - global fileName -diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions -index ee8c4ff..67e3848 100755 ---- a/build-aux/extract-ofp-actions -+++ b/build-aux/extract-ofp-actions -@@ -67,7 +67,7 @@ def fatal(msg): - - def usage(): - argv0 = os.path.basename(sys.argv[0]) -- print ('''\ -+ print('''\ - %(argv0)s, for extracting OpenFlow action data - usage: %(argv0)s OFP_ACTIONS.C [--prototypes | --definitions] - -@@ -238,36 +238,36 @@ def extract_ofp_actions(fn, definitions): - if n_errors: - sys.exit(1) - -- print """\ -+ print("""\ - /* Generated automatically; do not modify! -*- buffer-read-only: t -*- */ --""" -+""") - - if definitions: -- print "/* Verify that structs used as actions are reasonable sizes. */" -+ print("/* Verify that structs used as actions are reasonable sizes. */") - for s in sorted(arg_structs): -- print "BUILD_ASSERT_DECL(sizeof(%s) %% OFP_ACTION_ALIGN == 0);" % s -+ print("BUILD_ASSERT_DECL(sizeof(%s) %% OFP_ACTION_ALIGN == 0);" % s) - -- print "\nstatic struct ofpact_raw_instance all_raw_instances[] = {" -+ print("\nstatic struct ofpact_raw_instance all_raw_instances[] = {") - for vendor in domain: - for type_ in domain[vendor]: - for version in domain[vendor][type_]: - d = domain[vendor][type_][version] -- print " { { 0x%08x, %2d, 0x%02x }, " % ( -- vendor, type_, version) -- print " %s," % d["enum"] -- print " HMAP_NODE_NULL_INITIALIZER," -- print " HMAP_NODE_NULL_INITIALIZER," -- print " %s," % d["min_length"] -- print " %s," % d["max_length"] -- print " %s," % d["arg_ofs"] -- print " %s," % d["arg_len"] -- print " \"%s\"," % re.sub('_RAW[0-9]*', '', d["enum"], 1) -+ print(" { { 0x%08x, %2d, 0x%02x }, " % ( -+ vendor, type_, version)) -+ print(" %s," % d["enum"]) -+ print(" HMAP_NODE_NULL_INITIALIZER,") -+ print(" HMAP_NODE_NULL_INITIALIZER,") -+ print(" %s," % d["min_length"]) -+ print(" %s," % d["max_length"]) -+ print(" %s," % d["arg_ofs"]) -+ print(" %s," % d["arg_len"]) -+ print(" \"%s\"," % re.sub('_RAW[0-9]*', '', d["enum"], 1)) - if d["deprecation"]: -- print " \"%s\"," % re.sub(r'(["\\])', r'\\\1', d["deprecation"]) -+ print(" \"%s\"," % re.sub(r'(["\\])', r'\\\1', d["deprecation"])) - else: -- print " NULL," -- print " }," -- print "};"; -+ print(" NULL,") -+ print(" },") -+ print("};") - - for versions in enums.values(): - need_ofp_version = False -@@ -314,11 +314,11 @@ def extract_ofp_actions(fn, definitions): - decl += "}" - else: - decl += ";" -- print decl -- print -+ print(decl) -+ print("") - - if definitions: -- print """\ -+ print("""\ - static enum ofperr - ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, - enum ofp_version version, uint64_t arg, -@@ -326,14 +326,14 @@ ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, - uint64_t *tlv_bitmap, struct ofpbuf *out) - { - switch (raw) {\ --""" -+""") - for versions in enums.values(): - enum = versions[0]["enum"] -- print " case %s:" % enum -+ print(" case %s:" % enum) - base_argtype = versions[0]["base_argtype"] - arg_vl_mff_map = versions[0]["arg_vl_mff_map"] - if base_argtype == 'void': -- print " return decode_%s(out);" % enum -+ print(" return decode_%s(out);" % enum) - else: - if base_argtype.startswith('struct'): - arg = "ALIGNED_CAST(const %s *, a)" % base_argtype -@@ -344,16 +344,16 @@ ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, - else: - arg = "arg" - if arg_vl_mff_map: -- print " return decode_%s(%s, version, vl_mff_map, tlv_bitmap, out);" % (enum, arg) -+ print(" return decode_%s(%s, version, vl_mff_map, tlv_bitmap, out);" % (enum, arg)) - else: -- print " return decode_%s(%s, version, out);" % (enum, arg) -- print -- print """\ -+ print(" return decode_%s(%s, version, out);" % (enum, arg)) -+ print("") -+ print("""\ - default: - OVS_NOT_REACHED(); - } - }\ --""" -+""") - else: - for versions in enums.values(): - enum = versions[0]["enum"] -@@ -368,15 +368,15 @@ ofpact_decode(const struct ofp_action_header *a, enum ofp_raw_action_type raw, - if arg_vl_mff_map: - prototype += 'const struct vl_mff_map *, uint64_t *, ' - prototype += "struct ofpbuf *);" -- print prototype -+ print(prototype) - -- print """ -+ print(""" - static enum ofperr ofpact_decode(const struct ofp_action_header *, - enum ofp_raw_action_type raw, - enum ofp_version version, - uint64_t arg, const struct vl_mff_map *vl_mff_map, - uint64_t *tlv_bitmap, struct ofpbuf *out); --""" -+""") - - if __name__ == '__main__': - if '--help' in sys.argv: -diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors -index e36444e..97d62d2 100755 ---- a/build-aux/extract-ofp-errors -+++ b/build-aux/extract-ofp-errors -@@ -426,7 +426,7 @@ static const struct ofperr_domain %s = { - vendor, type_, code = map[enum] - if code == None: - code = -1 -- print " { %#8x, %2d, %3d }, /* %s */" % (vendor, type_, code, enum) -+ print (" { %#8x, %2d, %3d }, /* %s */" % (vendor, type_, code, enum)) - else: - print (" { -1, -1, -1 }, /* %s */" % enum) - print ("""\ -diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields -index c248e76..80c7d35 100755 ---- a/build-aux/extract-ofp-fields -+++ b/build-aux/extract-ofp-fields -@@ -728,7 +728,7 @@ def make_ovs_fields(meta_flow_h, meta_flow_xml): - ovs\-fields \- protocol header fields in OpenFlow and Open vSwitch - . - .PP --''') % version -+''' % version) - - recursively_replace(doc, 'oxm_classes', make_oxm_classes_xml(document)) - -diff --git a/build-aux/extract-ofp-msgs b/build-aux/extract-ofp-msgs -index c2a91f9..92c4bda 100755 ---- a/build-aux/extract-ofp-msgs -+++ b/build-aux/extract-ofp-msgs -@@ -56,14 +56,14 @@ def fatal(msg): - - def usage(): - argv0 = os.path.basename(sys.argv[0]) -- print '''\ -+ print('''\ - %(argv0)s, for extracting OpenFlow message types from header files - usage: %(argv0)s INPUT OUTPUT - where INPUT is the name of the input header file - and OUTPUT is the output file name. - Despite OUTPUT, the output is written to stdout, and the OUTPUT argument - only controls #line directives in the output.\ --''' % {"argv0": argv0} -+''' % {"argv0": argv0}) - sys.exit(0) - - def make_sizeof(s): -@@ -378,5 +378,5 @@ if __name__ == '__main__': - line_number = 0 - - for line in extract_ofp_msgs(sys.argv[2]): -- print line -+ print(line) - -diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc -index bdf2dcc..e82ad59 100755 ---- a/ovsdb/ovsdb-doc -+++ b/ovsdb/ovsdb-doc -@@ -258,7 +258,7 @@ represent strong references; thin lines represent weak references. - return s - - def usage(): -- print """\ -+ print("""\ - %(argv0)s: ovsdb schema documentation generator - Prints documentation for an OVSDB schema as an nroff-formatted manpage. - usage: %(argv0)s [OPTIONS] SCHEMA XML -@@ -269,7 +269,7 @@ The following options are also available: - --er-diagram=DIAGRAM.PIC include E-R diagram from DIAGRAM.PIC - --version=VERSION use VERSION to display on document footer - -h, --help display this help message\ --""" % {'argv0': argv0} -+""" % {'argv0': argv0}) - sys.exit(0) - - if __name__ == "__main__": -@@ -304,7 +304,7 @@ if __name__ == "__main__": - for line in s.split("\n"): - line = line.strip() - if len(line): -- print line -+ print(line) - - except error.Error, e: - sys.stderr.write("%s: %s\n" % (argv0, e.msg)) -diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in -index bfbcf23..62442ee 100755 ---- a/ovsdb/ovsdb-idlc.in -+++ b/ovsdb/ovsdb-idlc.in -@@ -1,5 +1,6 @@ - #! /usr/bin/env @PYTHON@ - -+from __future__ import print_function - import getopt - import os - import re -@@ -123,7 +124,7 @@ def sorted_columns(table): - def printCIDLHeader(schemaFile): - schema = parseSchema(schemaFile) - prefix = schema.idlPrefix -- print '''\ -+ print('''\ - /* Generated automatically -- do not modify! -*- buffer-read-only: t -*- */ - - #ifndef %(prefix)sIDL_HEADER -@@ -135,39 +136,39 @@ def printCIDLHeader(schemaFile): - #include "ovsdb-data.h" - #include "ovsdb-idl-provider.h" - #include "smap.h" --#include "uuid.h"''' % {'prefix': prefix.upper()} -+#include "uuid.h"''' % {'prefix': prefix.upper()}) - - for tableName, table in sorted(schema.tables.iteritems()): - structName = "%s%s" % (prefix, tableName.lower()) - -- print "" -- print "/* %s table. */" % tableName -- print "struct %s {" % structName -- print "\tstruct ovsdb_idl_row header_;" -+ print("") -+ print("/* %s table. */" % tableName) -+ print("struct %s {" % structName) -+ print("\tstruct ovsdb_idl_row header_;") - for columnName, column in sorted_columns(table): -- print "\n\t/* %s column. */" % columnName -+ print("\n\t/* %s column. */" % columnName) - comment, members = cMembers(prefix, tableName, - columnName, column, False) - for member in members: -- print "\t%(type)s%(name)s;%(comment)s" % member -- print "};" -+ print("\t%(type)s%(name)s;%(comment)s" % member) -+ print("};") - - # Column indexes. - printEnum("%s_column_id" % structName.lower(), ["%s_COL_%s" % (structName.upper(), columnName.upper()) - for columnName, column in sorted_columns(table)] - + ["%s_N_COLUMNS" % structName.upper()]) - -- print -+ print("") - for columnName in table.columns: -- print "#define %(s)s_col_%(c)s (%(s)s_columns[%(S)s_COL_%(C)s])" % { -+ print("#define %(s)s_col_%(c)s (%(s)s_columns[%(S)s_COL_%(C)s])" % { - 's': structName, - 'S': structName.upper(), - 'c': columnName, -- 'C': columnName.upper()} -+ 'C': columnName.upper()}) - -- print "\nextern struct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (structName, structName.upper()) -+ print("\nextern struct ovsdb_idl_column %s_columns[%s_N_COLUMNS];" % (structName, structName.upper())) - -- print ''' -+ print(''' - const struct %(s)s *%(s)s_get_for_uuid(const struct ovsdb_idl *, const struct uuid *); - const struct %(s)s *%(s)s_first(const struct ovsdb_idl *); - const struct %(s)s *%(s)s_next(const struct %(s)s *); -@@ -205,87 +206,87 @@ void %(s)s_init(struct %(s)s *); - void %(s)s_delete(const struct %(s)s *); - struct %(s)s *%(s)s_insert(struct ovsdb_idl_txn *); - bool %(s)s_is_updated(const struct %(s)s *, enum %(s)s_column_id); --''' % {'s': structName, 'S': structName.upper()} -+''' % {'s': structName, 'S': structName.upper()}) - - for columnName, column in sorted_columns(table): -- print 'void %(s)s_verify_%(c)s(const struct %(s)s *);' % {'s': structName, 'c': columnName} -+ print('void %(s)s_verify_%(c)s(const struct %(s)s *);' % {'s': structName, 'c': columnName}) - -- print -+ print("") - for columnName, column in sorted_columns(table): - if column.type.value: - valueParam = ', enum ovsdb_atomic_type value_type' - else: - valueParam = '' -- print 'const struct ovsdb_datum *%(s)s_get_%(c)s(const struct %(s)s *, enum ovsdb_atomic_type key_type%(v)s);' % { -- 's': structName, 'c': columnName, 'v': valueParam} -+ print('const struct ovsdb_datum *%(s)s_get_%(c)s(const struct %(s)s *, enum ovsdb_atomic_type key_type%(v)s);' % { -+ 's': structName, 'c': columnName, 'v': valueParam}) - -- print -+ print("") - for columnName, column in sorted_columns(table): -- print 'void %(s)s_set_%(c)s(const struct %(s)s *,' % {'s': structName, 'c': columnName}, -+ print('void %(s)s_set_%(c)s(const struct %(s)s *,' % {'s': structName, 'c': columnName}, end=' ') - if column.type.is_smap(): - args = ['const struct smap *'] - else: - comment, members = cMembers(prefix, tableName, columnName, - column, True) - args = ['%(type)s%(name)s' % member for member in members] -- print '%s);' % ', '.join(args) -+ print('%s);' % ', '.join(args)) - -- print -+ print("") - for columnName, column in sorted_columns(table): - if column.type.is_map(): -- print 'void %(s)s_update_%(c)s_setkey(const struct %(s)s *, ' % {'s': structName, 'c': columnName}, -- print '%(coltype)s, %(valtype)s);' % {'coltype':column.type.key.to_const_c_type(prefix), 'valtype':column.type.value.to_const_c_type(prefix)} -- print 'void %(s)s_update_%(c)s_delkey(const struct %(s)s *, ' % {'s': structName, 'c': columnName}, -- print '%(coltype)s);' % {'coltype':column.type.key.to_const_c_type(prefix)} -+ print('void %(s)s_update_%(c)s_setkey(const struct %(s)s *, ' % {'s': structName, 'c': columnName}, end=' ') -+ print('%(coltype)s, %(valtype)s);' % {'coltype':column.type.key.to_const_c_type(prefix), 'valtype':column.type.value.to_const_c_type(prefix)}) -+ print('void %(s)s_update_%(c)s_delkey(const struct %(s)s *, ' % {'s': structName, 'c': columnName}, end=' ') -+ print('%(coltype)s);' % {'coltype':column.type.key.to_const_c_type(prefix)}) - if column.type.is_set(): -- print 'void %(s)s_update_%(c)s_addvalue(const struct %(s)s *, ' % {'s': structName, 'c': columnName}, -- print '%(valtype)s);' % {'valtype':column.type.key.to_const_c_type(prefix)} -- print 'void %(s)s_update_%(c)s_delvalue(const struct %(s)s *, ' % {'s': structName, 'c': columnName}, -- print '%(valtype)s);' % {'valtype':column.type.key.to_const_c_type(prefix)} -+ print('void %(s)s_update_%(c)s_addvalue(const struct %(s)s *, ' % {'s': structName, 'c': columnName}, end=' ') -+ print('%(valtype)s);' % {'valtype':column.type.key.to_const_c_type(prefix)}) -+ print('void %(s)s_update_%(c)s_delvalue(const struct %(s)s *, ' % {'s': structName, 'c': columnName}, end=' ') -+ print('%(valtype)s);' % {'valtype':column.type.key.to_const_c_type(prefix)}) - -- print 'void %(s)s_add_clause_%(c)s(struct ovsdb_idl_condition *, enum ovsdb_function function,' % {'s': structName, 'c': columnName}, -+ print('void %(s)s_add_clause_%(c)s(struct ovsdb_idl_condition *, enum ovsdb_function function,' % {'s': structName, 'c': columnName}, end=' ') - if column.type.is_smap(): - args = ['const struct smap *'] - else: - comment, members = cMembers(prefix, tableName, columnName, - column, True, refTable=False) - args = ['%(type)s%(name)s' % member for member in members] -- print '%s);' % ', '.join(args) -+ print('%s);' % ', '.join(args)) - -- print 'void %(s)s_set_condition(struct ovsdb_idl *, struct ovsdb_idl_condition *);' % {'s': structName}, -+ print('void %(s)s_set_condition(struct ovsdb_idl *, struct ovsdb_idl_condition *);' % {'s': structName}) - -- print -+ print("") - - # Table indexes. - printEnum("%stable_id" % prefix.lower(), ["%sTABLE_%s" % (prefix.upper(), tableName.upper()) for tableName in sorted(schema.tables)] + ["%sN_TABLES" % prefix.upper()]) -- print -+ print("") - for tableName in schema.tables: -- print "#define %(p)stable_%(t)s (%(p)stable_classes[%(P)sTABLE_%(T)s])" % { -+ print("#define %(p)stable_%(t)s (%(p)stable_classes[%(P)sTABLE_%(T)s])" % { - 'p': prefix, - 'P': prefix.upper(), - 't': tableName.lower(), -- 'T': tableName.upper()} -- print "\nextern struct ovsdb_idl_table_class %stable_classes[%sN_TABLES];" % (prefix, prefix.upper()) -+ 'T': tableName.upper()}) -+ print("\nextern struct ovsdb_idl_table_class %stable_classes[%sN_TABLES];" % (prefix, prefix.upper())) - -- print "\nextern struct ovsdb_idl_class %sidl_class;" % prefix -+ print("\nextern struct ovsdb_idl_class %sidl_class;" % prefix) - -- print "\nconst char * %sget_db_version(void);" % prefix -- print "\n#endif /* %(prefix)sIDL_HEADER */" % {'prefix': prefix.upper()} -+ print("\nconst char * %sget_db_version(void);" % prefix) -+ print("\n#endif /* %(prefix)sIDL_HEADER */" % {'prefix': prefix.upper()}) - - def printEnum(type, members): - if len(members) == 0: - return - -- print "\nenum %s {" % type -+ print("\nenum %s {" % type) - for member in members[:-1]: -- print " %s," % member -- print " %s" % members[-1] -- print "};" -+ print(" %s," % member) -+ print(" %s" % members[-1]) -+ print("};") - - def printCIDLSource(schemaFile): - schema = parseSchema(schemaFile) - prefix = schema.idlPrefix -- print '''\ -+ print('''\ - /* Generated automatically -- do not modify! -*- buffer-read-only: t -*- */ - - #include <config.h> -@@ -296,33 +297,33 @@ def printCIDLSource(schemaFile): - #include "ovsdb-error.h" - #include "util.h" - --''' % schema.idlHeader -+''' % schema.idlHeader) - - # Cast functions. - for tableName, table in sorted(schema.tables.iteritems()): - structName = "%s%s" % (prefix, tableName.lower()) -- print ''' -+ print(''' - static struct %(s)s * - %(s)s_cast(const struct ovsdb_idl_row *row) - { - return row ? CONTAINER_OF(row, struct %(s)s, header_) : NULL; - }\ --''' % {'s': structName} -+''' % {'s': structName}) - - - for tableName, table in sorted(schema.tables.iteritems()): - structName = "%s%s" % (prefix, tableName.lower()) -- print "" -- print "/* %s table. */" % (tableName) -+ print("") -+ print("/* %s table. */" % (tableName)) - - # Parse functions. - for columnName, column in sorted_columns(table): -- print ''' -+ print(''' - static void - %(s)s_parse_%(c)s(struct ovsdb_idl_row *row_, const struct ovsdb_datum *datum) - { - struct %(s)s *row = %(s)s_cast(row_);''' % {'s': structName, -- 'c': columnName} -+ 'c': columnName}) - type = column.type - if type.value: - keyVar = "row->key_%s" % columnName -@@ -332,89 +333,89 @@ static void - valueVar = None - - if type.is_smap(): -- print " smap_init(&row->%s);" % columnName -- print " for (size_t i = 0; i < datum->n; i++) {" -- print " smap_add(&row->%s," % columnName -- print " datum->keys[i].string," -- print " datum->values[i].string);" -- print " }" -+ print(" smap_init(&row->%s);" % columnName) -+ print(" for (size_t i = 0; i < datum->n; i++) {") -+ print(" smap_add(&row->%s," % columnName) -+ print(" datum->keys[i].string,") -+ print(" datum->values[i].string);") -+ print(" }") - elif (type.n_min == 1 and type.n_max == 1) or type.is_optional_pointer(): -- print -- print " if (datum->n >= 1) {" -+ print("") -+ print(" if (datum->n >= 1) {") - if not type.key.ref_table: -- print " %s = datum->keys[0].%s;" % (keyVar, type.key.type.to_string()) -+ print(" %s = datum->keys[0].%s;" % (keyVar, type.key.type.to_string())) - else: -- print " %s = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_%s, &datum->keys[0].uuid));" % (keyVar, prefix, type.key.ref_table.name.lower(), prefix, type.key.ref_table.name.lower()) -+ print(" %s = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_%s, &datum->keys[0].uuid));" % (keyVar, prefix, type.key.ref_table.name.lower(), prefix, type.key.ref_table.name.lower())) - - if valueVar: - if not type.value.ref_table: -- print " %s = datum->values[0].%s;" % (valueVar, type.value.type.to_string()) -+ print(" %s = datum->values[0].%s;" % (valueVar, type.value.type.to_string())) - else: -- print " %s = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_%s, &datum->values[0].uuid));" % (valueVar, prefix, type.value.ref_table.name.lower(), prefix, type.value.ref_table.name.lower()) -- print " } else {" -- print " %s" % type.key.initCDefault(keyVar, type.n_min == 0) -+ print(" %s = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_%s, &datum->values[0].uuid));" % (valueVar, prefix, type.value.ref_table.name.lower(), prefix, type.value.ref_table.name.lower())) -+ print(" } else {") -+ print(" %s" % type.key.initCDefault(keyVar, type.n_min == 0)) - if valueVar: -- print " %s" % type.value.initCDefault(valueVar, type.n_min == 0) -- print " }" -+ print(" %s" % type.value.initCDefault(valueVar, type.n_min == 0)) -+ print(" }") - else: - if type.n_max != sys.maxint: -- print " size_t n = MIN(%d, datum->n);" % type.n_max -+ print(" size_t n = MIN(%d, datum->n);" % type.n_max) - nMax = "n" - else: - nMax = "datum->n" -- print " %s = NULL;" % keyVar -+ print(" %s = NULL;" % keyVar) - if valueVar: -- print " %s = NULL;" % valueVar -- print " row->n_%s = 0;" % columnName -- print " for (size_t i = 0; i < %s; i++) {" % nMax -+ print(" %s = NULL;" % valueVar) -+ print(" row->n_%s = 0;" % columnName) -+ print(" for (size_t i = 0; i < %s; i++) {" % nMax) - if type.key.ref_table: -- print """\ -+ print("""\ - struct %s%s *keyRow = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_%s, &datum->keys[i].uuid)); - if (!keyRow) { - continue; - }\ --""" % (prefix, type.key.ref_table.name.lower(), prefix, type.key.ref_table.name.lower(), prefix, type.key.ref_table.name.lower()) -+""" % (prefix, type.key.ref_table.name.lower(), prefix, type.key.ref_table.name.lower(), prefix, type.key.ref_table.name.lower())) - keySrc = "keyRow" - else: - keySrc = "datum->keys[i].%s" % type.key.type.to_string() - if type.value and type.value.ref_table: -- print """\ -+ print("""\ - struct %s%s *valueRow = %s%s_cast(ovsdb_idl_get_row_arc(row_, &%stable_%s, &datum->values[i].uuid)); - if (!valueRow) { - continue; - }\ --""" % (prefix, type.value.ref_table.name.lower(), prefix, type.value.ref_table.name.lower(), prefix, type.value.ref_table.name.lower()) -+""" % (prefix, type.value.ref_table.name.lower(), prefix, type.value.ref_table.name.lower(), prefix, type.value.ref_table.name.lower())) - valueSrc = "valueRow" - elif valueVar: - valueSrc = "datum->values[i].%s" % type.value.type.to_string() -- print " if (!row->n_%s) {" % (columnName) -+ print(" if (!row->n_%s) {" % (columnName)) - -- print " %s = xmalloc(%s * sizeof *%s);" % ( -- keyVar, nMax, keyVar) -+ print(" %s = xmalloc(%s * sizeof *%s);" % ( -+ keyVar, nMax, keyVar)) - if valueVar: -- print " %s = xmalloc(%s * sizeof *%s);" % ( -- valueVar, nMax, valueVar) -- print " }" -- print " %s[row->n_%s] = %s;" % (keyVar, columnName, keySrc) -+ print(" %s = xmalloc(%s * sizeof *%s);" % ( -+ valueVar, nMax, valueVar)) -+ print(" }") -+ print(" %s[row->n_%s] = %s;" % (keyVar, columnName, keySrc)) - if valueVar: -- print " %s[row->n_%s] = %s;" % (valueVar, columnName, valueSrc) -- print " row->n_%s++;" % columnName -- print " }" -- print "}" -+ print(" %s[row->n_%s] = %s;" % (valueVar, columnName, valueSrc)) -+ print(" row->n_%s++;" % columnName) -+ print(" }") -+ print("}") - - # Unparse functions. - for columnName, column in sorted_columns(table): - type = column.type - if type.is_smap() or (type.n_min != 1 or type.n_max != 1) and not type.is_optional_pointer(): -- print ''' -+ print(''' - static void - %(s)s_unparse_%(c)s(struct ovsdb_idl_row *row_) - { - struct %(s)s *row = %(s)s_cast(row_);''' % {'s': structName, -- 'c': columnName} -+ 'c': columnName}) - - if type.is_smap(): -- print " smap_destroy(&row->%s);" % columnName -+ print(" smap_destroy(&row->%s);" % columnName) - else: - if type.value: - keyVar = "row->key_%s" % columnName -@@ -422,45 +423,45 @@ static void - else: - keyVar = "row->%s" % columnName - valueVar = None -- print " free(%s);" % keyVar -+ print(" free(%s);" % keyVar) - if valueVar: -- print " free(%s);" % valueVar -- print '}' -+ print(" free(%s);" % valueVar) -+ print('}') - else: -- print ''' -+ print(''' - static void - %(s)s_unparse_%(c)s(struct ovsdb_idl_row *row OVS_UNUSED) - { - /* Nothing to do. */ --}''' % {'s': structName, 'c': columnName} -+}''' % {'s': structName, 'c': columnName}) - - # Generic Row Initialization function. -- print """ -+ print(""" - static void - %(s)s_init__(struct ovsdb_idl_row *row) - { - %(s)s_init(%(s)s_cast(row)); --}""" % {'s': structName} -+}""" % {'s': structName}) - - # Row Initialization function. -- print """ -+ print(""" - /* Clears the contents of 'row' in table "%(t)s". */ - void - %(s)s_init(struct %(s)s *row) - { -- memset(row, 0, sizeof *row); """ % {'s': structName, 't': tableName} -+ memset(row, 0, sizeof *row); """ % {'s': structName, 't': tableName}) - for columnName, column in sorted_columns(table): - if column.type.is_smap(): -- print " smap_init(&row->%s);" % columnName -+ print(" smap_init(&row->%s);" % columnName) - elif (column.type.n_min == 1 and - column.type.n_max == 1 and - column.type.key.type == ovs.db.types.StringType and - not column.type.value): -- print " row->%s = \"\";" % columnName -- print "}" -+ print(" row->%s = \"\";" % columnName) -+ print("}") - - # First, next functions. -- print ''' -+ print(''' - /* Searches table "%(t)s" in 'idl' for a row with UUID 'uuid'. Returns - * a pointer to the row if there is one, otherwise a null pointer. */ - const struct %(s)s * -@@ -514,9 +515,9 @@ const struct %(s)s - 'P': prefix.upper(), - 't': tableName, - 'tl': tableName.lower(), -- 'T': tableName.upper()} -+ 'T': tableName.upper()}) - -- print ''' -+ print(''' - - /* Deletes 'row' from table "%(t)s". 'row' may be freed, so it must not be - * accessed afterward. -@@ -550,11 +551,11 @@ bool - 'P': prefix.upper(), - 't': tableName, - 'tl': tableName.lower(), -- 'T': tableName.upper()} -+ 'T': tableName.upper()}) - - # Verify functions. - for columnName, column in sorted_columns(table): -- print ''' -+ print(''' - /* Causes the original contents of column "%(c)s" in 'row' to be - * verified as a prerequisite to completing the transaction. That is, if - * "%(c)s" in 'row' changed (or if 'row' was deleted) between the -@@ -585,7 +586,7 @@ void - }''' % {'s': structName, - 'S': structName.upper(), - 'c': columnName, -- 'C': columnName.upper()} -+ 'C': columnName.upper()}) - - # Get functions. - for columnName, column in sorted_columns(table): -@@ -597,7 +598,7 @@ void - valueParam = '' - valueType = '' - valueComment = '' -- print """ -+ print(""" - /* Returns the "%(c)s" column's value from the "%(t)s" table in 'row' - * as a struct ovsdb_datum. This is useful occasionally: for example, - * ovsdb_datum_find_key() is an easier and more efficient way to search -@@ -625,7 +626,7 @@ const struct ovsdb_datum * - return ovsdb_idl_read(&row->header_, &%(s)s_col_%(c)s); - }""" % {'t': tableName, 's': structName, 'c': columnName, - 'kt': column.type.key.toAtomicType(), -- 'v': valueParam, 'vt': valueType, 'vc': valueComment} -+ 'v': valueParam, 'vt': valueType, 'vc': valueComment}) - - # Set functions. - for columnName, column in sorted_columns(table): -@@ -635,8 +636,8 @@ const struct ovsdb_datum * - column, True) - - if type.is_smap(): -- print comment -- print """void -+ print(comment) -+ print("""void - %(s)s_set_%(c)s(const struct %(s)s *row, const struct smap *%(c)s) - { - struct ovsdb_datum datum; -@@ -654,7 +655,7 @@ const struct ovsdb_datum * - 's': structName, - 'S': structName.upper(), - 'c': columnName, -- 'C': columnName.upper()} -+ 'C': columnName.upper()}) - continue - - keyVar = members[0]['name'] -@@ -668,84 +669,84 @@ const struct ovsdb_datum * - if len(members) > 1: - nVar = members[1]['name'] - -- print comment -- print """\ -+ print(comment) -+ print("""\ - void - %(s)s_set_%(c)s(const struct %(s)s *row, %(args)s) - { - struct ovsdb_datum datum;""" % {'s': structName, - 'c': columnName, - 'args': ', '.join(['%(type)s%(name)s' -- % m for m in members])} -+ % m for m in members])}) - if type.n_min == 1 and type.n_max == 1: -- print " union ovsdb_atom key;" -+ print(" union ovsdb_atom key;") - if type.value: -- print " union ovsdb_atom value;" -- print -- print " datum.n = 1;" -- print " datum.keys = &key;" -- print " " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), keyVar) -+ print(" union ovsdb_atom value;") -+ print("") -+ print(" datum.n = 1;") -+ print(" datum.keys = &key;") -+ print(" " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), keyVar)) - if type.value: -- print " datum.values = &value;" -- print " "+ type.value.assign_c_value_casting_away_const("value.%s" % type.value.type.to_string(), valueVar) -+ print(" datum.values = &value;") -+ print(" "+ type.value.assign_c_value_casting_away_const("value.%s" % type.value.type.to_string(), valueVar)) - else: -- print " datum.values = NULL;" -+ print(" datum.values = NULL;") - txn_write_func = "ovsdb_idl_txn_write_clone" - elif type.is_optional_pointer(): -- print " union ovsdb_atom key;" -- print -- print " if (%s) {" % keyVar -- print " datum.n = 1;" -- print " datum.keys = &key;" -- print " " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), keyVar) -- print " } else {" -- print " datum.n = 0;" -- print " datum.keys = NULL;" -- print " }" -- print " datum.values = NULL;" -+ print(" union ovsdb_atom key;") -+ print("") -+ print(" if (%s) {" % keyVar) -+ print(" datum.n = 1;") -+ print(" datum.keys = &key;") -+ print(" " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), keyVar)) -+ print(" } else {") -+ print(" datum.n = 0;") -+ print(" datum.keys = NULL;") -+ print(" }") -+ print(" datum.values = NULL;") - txn_write_func = "ovsdb_idl_txn_write_clone" - elif type.n_max == 1: -- print " union ovsdb_atom key;" -- print -- print " if (%s) {" % nVar -- print " datum.n = 1;" -- print " datum.keys = &key;" -- print " " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), "*" + keyVar) -- print " } else {" -- print " datum.n = 0;" -- print " datum.keys = NULL;" -- print " }" -- print " datum.values = NULL;" -+ print(" union ovsdb_atom key;") -+ print("") -+ print(" if (%s) {" % nVar) -+ print(" datum.n = 1;") -+ print(" datum.keys = &key;") -+ print(" " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), "*" + keyVar)) -+ print(" } else {") -+ print(" datum.n = 0;") -+ print(" datum.keys = NULL;") -+ print(" }") -+ print(" datum.values = NULL;") - txn_write_func = "ovsdb_idl_txn_write_clone" - else: -- print -- print " datum.n = %s;" % nVar -- print " datum.keys = %s ? xmalloc(%s * sizeof *datum.keys) : NULL;" % (nVar, nVar) -+ print("") -+ print(" datum.n = %s;" % nVar) -+ print(" datum.keys = %s ? xmalloc(%s * sizeof *datum.keys) : NULL;" % (nVar, nVar)) - if type.value: -- print " datum.values = xmalloc(%s * sizeof *datum.values);" % nVar -+ print(" datum.values = xmalloc(%s * sizeof *datum.values);" % nVar) - else: -- print " datum.values = NULL;" -- print " for (size_t i = 0; i < %s; i++) {" % nVar -- print " " + type.key.copyCValue("datum.keys[i].%s" % type.key.type.to_string(), "%s[i]" % keyVar) -+ print(" datum.values = NULL;") -+ print(" for (size_t i = 0; i < %s; i++) {" % nVar) -+ print(" " + type.key.copyCValue("datum.keys[i].%s" % type.key.type.to_string(), "%s[i]" % keyVar)) - if type.value: -- print " " + type.value.copyCValue("datum.values[i].%s" % type.value.type.to_string(), "%s[i]" % valueVar) -- print " }" -+ print(" " + type.value.copyCValue("datum.values[i].%s" % type.value.type.to_string(), "%s[i]" % valueVar)) -+ print(" }") - if type.value: - valueType = type.value.toAtomicType() - else: - valueType = "OVSDB_TYPE_VOID" - txn_write_func = "ovsdb_idl_txn_write" -- print " %(f)s(&row->header_, &%(s)s_col_%(c)s, &datum);" \ -+ print(" %(f)s(&row->header_, &%(s)s_col_%(c)s, &datum);" \ - % {'f': txn_write_func, - 's': structName, - 'S': structName.upper(), -- 'c': columnName} -- print "}" -+ 'c': columnName}) -+ print("}") - # Update/Delete of partial map column functions - for columnName, column in sorted_columns(table): - type = column.type - if type.is_map(): -- print ''' -+ print(''' - /* Sets an element of the "%(c)s" map column from the "%(t)s" table in 'row' - * to 'new_value' given the key value 'new_key'. - * -@@ -761,17 +762,17 @@ void - datum->values = xmalloc(datum->n * sizeof *datum->values); - ''' % {'s': structName, 'c': columnName,'coltype':column.type.key.to_const_c_type(prefix), - 'valtype':column.type.value.to_const_c_type(prefix), 'S': structName.upper(), -- 'C': columnName.upper(), 't': tableName} -+ 'C': columnName.upper(), 't': tableName}) - -- print " "+ type.key.copyCValue("datum->keys[0].%s" % type.key.type.to_string(), "new_key") -- print " "+ type.value.copyCValue("datum->values[0].%s" % type.value.type.to_string(), "new_value") -- print ''' -+ print(" "+ type.key.copyCValue("datum->keys[0].%s" % type.key.type.to_string(), "new_key")) -+ print(" "+ type.value.copyCValue("datum->values[0].%s" % type.value.type.to_string(), "new_value")) -+ print(''' - ovsdb_idl_txn_write_partial_map(&row->header_, - &%(s)s_col_%(c)s, - datum); - }''' % {'s': structName, 'c': columnName,'coltype':column.type.key.toCType(prefix), -- 'valtype':column.type.value.to_const_c_type(prefix), 'S': structName.upper()} -- print ''' -+ 'valtype':column.type.value.to_const_c_type(prefix), 'S': structName.upper()}) -+ print(''' - /* Deletes an element of the "%(c)s" map column from the "%(t)s" table in 'row' - * given the key value 'delete_key'. - * -@@ -787,19 +788,19 @@ void - datum->values = NULL; - ''' % {'s': structName, 'c': columnName,'coltype':column.type.key.to_const_c_type(prefix), - 'valtype':column.type.value.to_const_c_type(prefix), 'S': structName.upper(), -- 'C': columnName.upper(), 't': tableName} -+ 'C': columnName.upper(), 't': tableName}) - -- print " "+ type.key.copyCValue("datum->keys[0].%s" % type.key.type.to_string(), "delete_key") -- print ''' -+ print(" "+ type.key.copyCValue("datum->keys[0].%s" % type.key.type.to_string(), "delete_key")) -+ print(''' - ovsdb_idl_txn_delete_partial_map(&row->header_, - &%(s)s_col_%(c)s, - datum); - }''' % {'s': structName, 'c': columnName,'coltype':column.type.key.toCType(prefix), -- 'valtype':column.type.value.to_const_c_type(prefix), 'S': structName.upper()} -+ 'valtype':column.type.value.to_const_c_type(prefix), 'S': structName.upper()}) - # End Update/Delete of partial maps - # Update/Delete of partial set column functions - if type.is_set(): -- print ''' -+ print(''' - /* Adds the value 'new_value' to the "%(c)s" set column from the "%(t)s" table - * in 'row'. - * -@@ -814,16 +815,16 @@ void - datum->keys = xmalloc(datum->n * sizeof *datum->values); - datum->values = NULL; - ''' % {'s': structName, 'c': columnName, -- 'valtype':column.type.key.to_const_c_type(prefix), 't': tableName} -+ 'valtype':column.type.key.to_const_c_type(prefix), 't': tableName}) - -- print " "+ type.key.copyCValue("datum->keys[0].%s" % type.key.type.to_string(), "new_value") -- print ''' -+ print(" "+ type.key.copyCValue("datum->keys[0].%s" % type.key.type.to_string(), "new_value")) -+ print(''' - ovsdb_idl_txn_write_partial_set(&row->header_, - &%(s)s_col_%(c)s, - datum); - }''' % {'s': structName, 'c': columnName,'coltype':column.type.key.toCType(prefix), -- 'valtype':column.type.key.to_const_c_type(prefix), 'S': structName.upper()} -- print ''' -+ 'valtype':column.type.key.to_const_c_type(prefix), 'S': structName.upper()}) -+ print(''' - /* Deletes the value 'delete_value' from the "%(c)s" set column from the - * "%(t)s" table in 'row'. - * -@@ -839,15 +840,15 @@ void - datum->values = NULL; - ''' % {'s': structName, 'c': columnName,'coltype':column.type.key.to_const_c_type(prefix), - 'valtype':column.type.key.to_const_c_type(prefix), 'S': structName.upper(), -- 'C': columnName.upper(), 't': tableName} -+ 'C': columnName.upper(), 't': tableName}) - -- print " "+ type.key.copyCValue("datum->keys[0].%s" % type.key.type.to_string(), "delete_value") -- print ''' -+ print(" "+ type.key.copyCValue("datum->keys[0].%s" % type.key.type.to_string(), "delete_value")) -+ print(''' - ovsdb_idl_txn_delete_partial_set(&row->header_, - &%(s)s_col_%(c)s, - datum); - }''' % {'s': structName, 'c': columnName,'coltype':column.type.key.toCType(prefix), -- 'valtype':column.type.key.to_const_c_type(prefix), 'S': structName.upper()} -+ 'valtype':column.type.key.to_const_c_type(prefix), 'S': structName.upper()}) - # End Update/Delete of partial set - - # Add clause functions. -@@ -858,8 +859,8 @@ void - column, True, refTable=False) - - if type.is_smap(): -- print comment -- print """void -+ print(comment) -+ print("""void - %(s)s_add_clause_%(c)s(struct ovsdb_idl_condition *cond, enum ovsdb_function function, const struct smap *%(c)s) - { - struct ovsdb_datum datum; -@@ -884,7 +885,7 @@ void - 'P': prefix.upper(), - 's': structName, - 'S': structName.upper(), -- 'c': columnName} -+ 'c': columnName}) - continue - - keyVar = members[0]['name'] -@@ -898,73 +899,73 @@ void - if len(members) > 1: - nVar = members[1]['name'] - -- print comment -- print 'void' -- print '%(s)s_add_clause_%(c)s(struct ovsdb_idl_condition *cond, enum ovsdb_function function, %(args)s)' % \ -+ print(comment) -+ print('void') -+ print('%(s)s_add_clause_%(c)s(struct ovsdb_idl_condition *cond, enum ovsdb_function function, %(args)s)' % \ - {'s': structName, 'c': columnName, -- 'args': ', '.join(['%(type)s%(name)s' % m for m in members])} -- print "{" -- print " struct ovsdb_datum datum;" -+ 'args': ', '.join(['%(type)s%(name)s' % m for m in members])}) -+ print("{") -+ print(" struct ovsdb_datum datum;") - free = [] - if type.n_min == 1 and type.n_max == 1: -- print " union ovsdb_atom key;" -+ print(" union ovsdb_atom key;") - if type.value: -- print " union ovsdb_atom value;" -- print -- print " datum.n = 1;" -- print " datum.keys = &key;" -- print " " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), keyVar, refTable=False) -+ print(" union ovsdb_atom value;") -+ print("") -+ print(" datum.n = 1;") -+ print(" datum.keys = &key;") -+ print(" " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), keyVar, refTable=False)) - if type.value: -- print " datum.values = &value;" -- print " "+ type.value.assign_c_value_casting_away_const("value.%s" % type.value.type.to_string(), valueVar, refTable=False) -+ print(" datum.values = &value;") -+ print(" "+ type.value.assign_c_value_casting_away_const("value.%s" % type.value.type.to_string(), valueVar, refTable=False)) - else: -- print " datum.values = NULL;" -+ print(" datum.values = NULL;") - elif type.is_optional_pointer(): -- print " union ovsdb_atom key;" -- print -- print " if (%s) {" % keyVar -- print " datum.n = 1;" -- print " datum.keys = &key;" -- print " " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), keyVar, refTable=False) -- print " } else {" -- print " datum.n = 0;" -- print " datum.keys = NULL;" -- print " }" -- print " datum.values = NULL;" -+ print(" union ovsdb_atom key;") -+ print("") -+ print(" if (%s) {" % keyVar) -+ print(" datum.n = 1;") -+ print(" datum.keys = &key;") -+ print(" " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), keyVar, refTable=False)) -+ print(" } else {") -+ print(" datum.n = 0;") -+ print(" datum.keys = NULL;") -+ print(" }") -+ print(" datum.values = NULL;") - elif type.n_max == 1: -- print " union ovsdb_atom key;" -- print -- print " if (%s) {" % nVar -- print " datum.n = 1;" -- print " datum.keys = &key;" -- print " " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), "*" + keyVar, refTable=False) -- print " } else {" -- print " datum.n = 0;" -- print " datum.keys = NULL;" -- print " }" -- print " datum.values = NULL;" -+ print(" union ovsdb_atom key;") -+ print("") -+ print(" if (%s) {" % nVar) -+ print(" datum.n = 1;") -+ print(" datum.keys = &key;") -+ print(" " + type.key.assign_c_value_casting_away_const("key.%s" % type.key.type.to_string(), "*" + keyVar, refTable=False)) -+ print(" } else {") -+ print(" datum.n = 0;") -+ print(" datum.keys = NULL;") -+ print(" }") -+ print(" datum.values = NULL;") - else: -- print " datum.n = %s;" % nVar -- print " datum.keys = %s ? xmalloc(%s * sizeof *datum.keys) : NULL;" % (nVar, nVar) -+ print(" datum.n = %s;" % nVar) -+ print(" datum.keys = %s ? xmalloc(%s * sizeof *datum.keys) : NULL;" % (nVar, nVar)) - free += ['datum.keys'] - if type.value: -- print " datum.values = xmalloc(%s * sizeof *datum.values);" % nVar -+ print(" datum.values = xmalloc(%s * sizeof *datum.values);" % nVar) - free += ['datum.values'] - else: -- print " datum.values = NULL;" -- print " for (size_t i = 0; i < %s; i++) {" % nVar -- print " " + type.key.assign_c_value_casting_away_const("datum.keys[i].%s" % type.key.type.to_string(), "%s[i]" % keyVar, refTable=False) -+ print(" datum.values = NULL;") -+ print(" for (size_t i = 0; i < %s; i++) {" % nVar) -+ print(" " + type.key.assign_c_value_casting_away_const("datum.keys[i].%s" % type.key.type.to_string(), "%s[i]" % keyVar, refTable=False)) - if type.value: -- print " " + type.value.assign_c_value_casting_away_const("datum.values[i].%s" % type.value.type.to_string(), "%s[i]" % valueVar, refTable=False) -- print " }" -+ print(" " + type.value.assign_c_value_casting_away_const("datum.values[i].%s" % type.value.type.to_string(), "%s[i]" % valueVar, refTable=False)) -+ print(" }") - if type.value: - valueType = type.value.toAtomicType() - else: - valueType = "OVSDB_TYPE_VOID" -- print " ovsdb_datum_sort_unique(&datum, %s, %s);" % ( -- type.key.toAtomicType(), valueType) -+ print(" ovsdb_datum_sort_unique(&datum, %s, %s);" % ( -+ type.key.toAtomicType(), valueType)) - -- print""" ovsdb_idl_condition_add_clause(cond, -+ print(""" ovsdb_idl_condition_add_clause(cond, - function, - &%(s)s_col_%(c)s, - &datum);\ -@@ -974,28 +975,28 @@ void - 'P': prefix.upper(), - 's': structName, - 'S': structName.upper(), -- 'c': columnName} -+ 'c': columnName}) - for var in free: -- print " free(%s);" % var -- print "}" -+ print(" free(%s);" % var) -+ print("}") - -- print """ -+ print(""" - void - %(s)s_set_condition(struct ovsdb_idl *idl, struct ovsdb_idl_condition *condition) - { - ovsdb_idl_set_condition(idl, &%(p)stable_%(tl)s, condition); - }""" % {'p': prefix, - 's': structName, -- 'tl': tableName.lower()} -+ 'tl': tableName.lower()}) - - # Table columns. - for columnName, column in sorted_columns(table): - prereqs = [] - x = column.type.cInitType("%s_col_%s" % (tableName, columnName), prereqs) - if prereqs: -- print '\n'.join(prereqs) -- print "\nstruct ovsdb_idl_column %s_columns[%s_N_COLUMNS] = {" % ( -- structName, structName.upper()) -+ print('\n'.join(prereqs)) -+ print("\nstruct ovsdb_idl_column %s_columns[%s_N_COLUMNS] = {" % ( -+ structName, structName.upper())) - for columnName, column in sorted_columns(table): - if column.mutable: - mutable = "true" -@@ -1003,7 +1004,7 @@ void - mutable = "false" - type_init = '\n'.join(" " + x - for x in column.type.cInitType("%s_col_%s" % (tableName, columnName), prereqs)) -- print """\ -+ print("""\ - [%(P)s%(T)s_COL_%(C)s] = { - .name = "%(c)s", - .type = { -@@ -1018,38 +1019,38 @@ void - 'C': columnName.upper(), - 's': structName, - 'mutable': mutable, -- 'type': type_init} -- print "};" -+ 'type': type_init}) -+ print("};") - - # Table classes. -- print "" -- print "struct ovsdb_idl_table_class %stable_classes[%sN_TABLES] = {" % (prefix, prefix.upper()) -+ print("") -+ print("struct ovsdb_idl_table_class %stable_classes[%sN_TABLES] = {" % (prefix, prefix.upper())) - for tableName, table in sorted(schema.tables.iteritems()): - structName = "%s%s" % (prefix, tableName.lower()) - if table.is_root: - is_root = "true" - else: - is_root = "false" -- print " {\"%s\", %s," % (tableName, is_root) -- print " %s_columns, ARRAY_SIZE(%s_columns)," % ( -- structName, structName) -- print " sizeof(struct %s), %s_init__}," % (structName, structName) -- print "};" -+ print(" {\"%s\", %s," % (tableName, is_root)) -+ print(" %s_columns, ARRAY_SIZE(%s_columns)," % ( -+ structName, structName)) -+ print(" sizeof(struct %s), %s_init__}," % (structName, structName)) -+ print("};") - - # IDL class. -- print "\nstruct ovsdb_idl_class %sidl_class = {" % prefix -- print " \"%s\", %stable_classes, ARRAY_SIZE(%stable_classes)" % ( -- schema.name, prefix, prefix) -- print "};" -+ print("\nstruct ovsdb_idl_class %sidl_class = {" % prefix) -+ print(" \"%s\", %stable_classes, ARRAY_SIZE(%stable_classes)" % ( -+ schema.name, prefix, prefix)) -+ print("};") - -- print """ -+ print(""" - /* Return the schema version. The caller must not free the returned value. */ - const char * - %sget_db_version(void) - { - return "%s"; - } --""" % (prefix, schema.version) -+""" % (prefix, schema.version)) - - - -@@ -1075,7 +1076,7 @@ def ovsdb_escape(string): - return re.sub(r'["\\\000-\037]', escape, string) - - def usage(): -- print """\ -+ print("""\ - %(argv0)s: ovsdb schema compiler - usage: %(argv0)s [OPTIONS] COMMAND ARG... - -@@ -1087,7 +1088,7 @@ The following commands are supported: - The following options are also available: - -h, --help display this help message - -V, --version display version information\ --""" % {'argv0': argv0} -+""" % {'argv0': argv0}) - sys.exit(0) - - if __name__ == "__main__": -@@ -1105,7 +1106,7 @@ if __name__ == "__main__": - if key in ['-h', '--help']: - usage() - elif key in ['-V', '--version']: -- print "ovsdb-idlc (Open vSwitch) @VERSION@" -+ print("ovsdb-idlc (Open vSwitch) @VERSION@") - elif key in ['-C', '--directory']: - os.chdir(value) - else: diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0001-use-the-linux-if_packet.h-Interface-directly.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0001-use-the-linux-if_packet.h-Interface-directly.patch deleted file mode 100644 index f1f9befe8..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0001-use-the-linux-if_packet.h-Interface-directly.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 28b2d17de9414161d5edd67766bd4b452cd809ef Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Mon, 20 Mar 2017 12:12:51 -0700 -Subject: [PATCH] use the linux if_packet.h Interface directly - -Helps compiling with musl - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - ---- - lib/netdev-linux.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c -index fccf88f..b703156 100644 ---- a/lib/netdev-linux.c -+++ b/lib/netdev-linux.c -@@ -33,14 +33,13 @@ - #include <linux/pkt_sched.h> - #include <linux/rtnetlink.h> - #include <linux/sockios.h> -+#include <linux/if_packet.h> - #include <sys/types.h> - #include <sys/ioctl.h> - #include <sys/socket.h> - #include <sys/utsname.h> --#include <netpacket/packet.h> - #include <net/if.h> - #include <net/if_arp.h> --#include <net/if_packet.h> - #include <net/route.h> - #include <netinet/in.h> - #include <poll.h> diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0002-Define-WAIT_ANY-if-not-provided-by-system.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0002-Define-WAIT_ANY-if-not-provided-by-system.patch deleted file mode 100644 index f997bbff7..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0002-Define-WAIT_ANY-if-not-provided-by-system.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 801023e72b31e7c49cbccedd76ade33a17fcbe45 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Mon, 20 Mar 2017 12:13:30 -0700 -Subject: [PATCH] Define WAIT_ANY if not provided by system - -POSIX does not define it and uses -1 directly -some libc do not have this definitions - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - ---- - tests/test-ovn.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tests/test-ovn.c b/tests/test-ovn.c -index 84adf81..2bc6bdf 100644 ---- a/tests/test-ovn.c -+++ b/tests/test-ovn.c -@@ -38,6 +38,10 @@ - #include "simap.h" - #include "util.h" - -+#ifndef WAIT_ANY -+# define WAIT_ANY (-1) /* Any process. */ -+#endif -+ - /* --relops: Bitmap of the relational operators to test, in exhaustive test. */ - static unsigned int test_relops; - diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0002-Python3-compatibility-exception-cleanup.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0002-Python3-compatibility-exception-cleanup.patch deleted file mode 100644 index 70abd263d..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0002-Python3-compatibility-exception-cleanup.patch +++ /dev/null @@ -1,77 +0,0 @@ -From c0ba116eab401431b4f11b66bd7d1b42741b03c3 Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Thu, 29 Jun 2017 20:33:23 -0700 -Subject: [PATCH] Python3 compatibility: exception cleanup - -Commit 52e4a477f0b3c0a0ece7adeede6e06e07814f8b9 from -https://github.com/openvswitch/ovs.git - -The exception syntax which is compatible with python2 and python3 is -to use the "as" form for "except:". - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Ben Pfaff <blp@ovn.org> - ---- - build-aux/extract-ofp-fields | 2 +- - ovsdb/ovsdb-doc | 4 ++-- - ovsdb/ovsdb-idlc.in | 4 ++-- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields -index 80c7d35..6286c9c 100755 ---- a/build-aux/extract-ofp-fields -+++ b/build-aux/extract-ofp-fields -@@ -784,7 +784,7 @@ if __name__ == "__main__": - try: - options, args = getopt.gnu_getopt(sys.argv[1:], 'h', - ['help', 'ovs-version=']) -- except getopt.GetoptError, geo: -+ except getopt.GetoptError as geo: - sys.stderr.write("%s: %s\n" % (argv0, geo.msg)) - sys.exit(1) - -diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc -index e82ad59..9448713 100755 ---- a/ovsdb/ovsdb-doc -+++ b/ovsdb/ovsdb-doc -@@ -278,7 +278,7 @@ if __name__ == "__main__": - options, args = getopt.gnu_getopt(sys.argv[1:], 'hV', - ['er-diagram=', - 'version=', 'help']) -- except getopt.GetoptError, geo: -+ except getopt.GetoptError as geo: - sys.stderr.write("%s: %s\n" % (argv0, geo.msg)) - sys.exit(1) - -@@ -306,7 +306,7 @@ if __name__ == "__main__": - if len(line): - print(line) - -- except error.Error, e: -+ except error.Error as e: - sys.stderr.write("%s: %s\n" % (argv0, e.msg)) - sys.exit(1) - -diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in -index 62442ee..e7e1c6b 100755 ---- a/ovsdb/ovsdb-idlc.in -+++ b/ovsdb/ovsdb-idlc.in -@@ -1098,7 +1098,7 @@ if __name__ == "__main__": - ['directory', - 'help', - 'version']) -- except getopt.GetoptError, geo: -+ except getopt.GetoptError as geo: - sys.stderr.write("%s: %s\n" % (argv0, geo.msg)) - sys.exit(1) - -@@ -1136,7 +1136,7 @@ if __name__ == "__main__": - sys.exit(1) - - func(*args[1:]) -- except ovs.db.error.Error, e: -+ except ovs.db.error.Error as e: - sys.stderr.write("%s: %s\n" % (argv0, e)) - sys.exit(1) - diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0003-Python3-compatibility-execfile-to-exec.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0003-Python3-compatibility-execfile-to-exec.patch deleted file mode 100644 index 98d77c8a7..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0003-Python3-compatibility-execfile-to-exec.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8557d51e8c7325a17219911e9a65eeb3946e869f Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Thu, 29 Jun 2017 20:33:23 -0700 -Subject: [PATCH] Python3 compatibility: execfile to exec - -Commit a4d10a7ca937d73873f6f98619d88682e69f5dbe from -https://github.com/openvswitch/ovs.git - -Allow compability with python3 and python2 by changing execfile() to -exec(). - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Ben Pfaff <blp@ovn.org> - ---- - ovsdb/ovsdb-idlc.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in -index e7e1c6b..e1551f9 100755 ---- a/ovsdb/ovsdb-idlc.in -+++ b/ovsdb/ovsdb-idlc.in -@@ -17,7 +17,7 @@ def parseSchema(filename): - - def annotateSchema(schemaFile, annotationFile): - schemaJson = ovs.json.from_file(schemaFile) -- execfile(annotationFile, globals(), {"s": schemaJson}) -+ exec(compile(open(annotationFile, "rb").read(), annotationFile, 'exec'), globals(), {"s": schemaJson}) - ovs.json.to_stream(schemaJson, sys.stdout) - sys.stdout.write('\n') - diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0004-Python3-compatibility-iteritems-to-items.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0004-Python3-compatibility-iteritems-to-items.patch deleted file mode 100644 index 092c42d69..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0004-Python3-compatibility-iteritems-to-items.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 7e4bd5c2af85b1293be0a92b18f7930bda2ab41a Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Thu, 29 Jun 2017 20:33:23 -0700 -Subject: [PATCH] Python3 compatibility: iteritems to items - -Commit 4ab665623cbb4c6506e48b82e0c9fe8585f42e13 from -https://github.com/openvswitch/ovs.git - -Allow compability with python3 and python2 by changing iteritems() to -items(). - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Ben Pfaff <blp@ovn.org> - ---- - build-aux/extract-ofp-actions | 2 +- - build-aux/extract-ofp-errors | 2 +- - build-aux/extract-ofp-fields | 2 +- - ovsdb/ovsdb-idlc.in | 8 ++++---- - 4 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions -index 67e3848..c7858bd 100755 ---- a/build-aux/extract-ofp-actions -+++ b/build-aux/extract-ofp-actions -@@ -13,7 +13,7 @@ version_map = {"1.0": 0x01, - "1.3": 0x04, - "1.4": 0x05, - "1.5": 0x06} --version_reverse_map = dict((v, k) for (k, v) in version_map.iteritems()) -+version_reverse_map = dict((v, k) for (k, v) in version_map.items()) - - # Map from vendor name to the length of the action header. - vendor_map = {"OF": (0x00000000, 4), -diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors -index 97d62d2..58ba006 100755 ---- a/build-aux/extract-ofp-errors -+++ b/build-aux/extract-ofp-errors -@@ -14,7 +14,7 @@ version_map = {"1.0": 0x01, - "1.4": 0x05, - "1.5": 0x06, - "1.6": 0x07} --version_reverse_map = dict((v, k) for (k, v) in version_map.iteritems()) -+version_reverse_map = dict((v, k) for (k, v) in version_map.items()) - - token = None - line = "" -diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields -index 6286c9c..f624728 100755 ---- a/build-aux/extract-ofp-fields -+++ b/build-aux/extract-ofp-fields -@@ -16,7 +16,7 @@ VERSION = {"1.0": 0x01, - "1.3": 0x04, - "1.4": 0x05, - "1.5": 0x06} --VERSION_REVERSE = dict((v,k) for k, v in VERSION.iteritems()) -+VERSION_REVERSE = dict((v,k) for k, v in VERSION.items()) - - TYPES = {"u8": (1, False), - "be16": (2, False), -diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in -index e1551f9..b70a599 100755 ---- a/ovsdb/ovsdb-idlc.in -+++ b/ovsdb/ovsdb-idlc.in -@@ -138,7 +138,7 @@ def printCIDLHeader(schemaFile): - #include "smap.h" - #include "uuid.h"''' % {'prefix': prefix.upper()}) - -- for tableName, table in sorted(schema.tables.iteritems()): -+ for tableName, table in sorted(schema.tables.items()): - structName = "%s%s" % (prefix, tableName.lower()) - - print("") -@@ -300,7 +300,7 @@ def printCIDLSource(schemaFile): - ''' % schema.idlHeader) - - # Cast functions. -- for tableName, table in sorted(schema.tables.iteritems()): -+ for tableName, table in sorted(schema.tables.items()): - structName = "%s%s" % (prefix, tableName.lower()) - print(''' - static struct %(s)s * -@@ -311,7 +311,7 @@ static struct %(s)s * - ''' % {'s': structName}) - - -- for tableName, table in sorted(schema.tables.iteritems()): -+ for tableName, table in sorted(schema.tables.items()): - structName = "%s%s" % (prefix, tableName.lower()) - print("") - print("/* %s table. */" % (tableName)) -@@ -1025,7 +1025,7 @@ void - # Table classes. - print("") - print("struct ovsdb_idl_table_class %stable_classes[%sN_TABLES] = {" % (prefix, prefix.upper())) -- for tableName, table in sorted(schema.tables.iteritems()): -+ for tableName, table in sorted(schema.tables.items()): - structName = "%s%s" % (prefix, tableName.lower()) - if table.is_root: - is_root = "true" diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch deleted file mode 100644 index d6f93646f..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch +++ /dev/null @@ -1,49 +0,0 @@ -From d22c7f1c6ade82a0cd646cfcd8df9adda6cd1ad6 Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Thu, 29 Jun 2017 20:33:23 -0700 -Subject: [PATCH] Python3 compatibility: fix integer problems - -Commit fa145f1a53943243f94a32ce98525db8494b0052 from -https://github.com/openvswitch/ovs.git - -In python3 maxint is not defined, but maxsize is defined in both -python2 and python3. - -The put_text() will not automatically use a value which came in as -float due to a pior math function and python3 will throw an exception. -The simple answer is to convert it with int() and move on. - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Ben Pfaff <blp@ovn.org> - ---- - ovsdb/ovsdb-idlc.in | 2 +- - python/build/nroff.py | 2 ++ - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in -index b70a599..3645275 100755 ---- a/ovsdb/ovsdb-idlc.in -+++ b/ovsdb/ovsdb-idlc.in -@@ -358,7 +358,7 @@ static void - print(" %s" % type.value.initCDefault(valueVar, type.n_min == 0)) - print(" }") - else: -- if type.n_max != sys.maxint: -+ if type.n_max != sys.maxsize: - print(" size_t n = MIN(%d, datum->n);" % type.n_max) - nMax = "n" - else: -diff --git a/python/build/nroff.py b/python/build/nroff.py -index c23837f..401f699 100644 ---- a/python/build/nroff.py -+++ b/python/build/nroff.py -@@ -148,6 +148,8 @@ def fatal(msg): - - - def put_text(text, x, y, s): -+ x = int(x) -+ y = int(y) - extend = x + len(s) - len(text[y]) - if extend > 0: - text[y] += ' ' * extend diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0006-Python3-compatibility-math-error-compatibility.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0006-Python3-compatibility-math-error-compatibility.patch deleted file mode 100644 index c53502b5d..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0006-Python3-compatibility-math-error-compatibility.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 7f542122d62b20d11198bfdb0f2c6a460261b5e7 Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Thu, 29 Jun 2017 20:33:23 -0700 -Subject: [PATCH] Python3 compatibility: math error compatibility - -Commit 3fa5aa4294377e0f35267936d0c5caea3e61db48 from -https://github.com/openvswitch/ovs.git - -The way math is handled with typing is completely different in python3. - -% python2<<EOF -x=10 -y=8 -print((x + (y - 1)) / y * y) -EOF -16 - -python3<<EOF -x=10 -y=8 -print((x + (y - 1)) / y * y) -EOF -17.0 - -So we need to force an integer for the round function as follows and -maintain compatibility with python2. - -python3<<EOF -x=10 -y=8 -print(int((x + (y - 1)) / y) * y) -EOF -16 - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Ben Pfaff <blp@ovn.org> - ---- - build-aux/extract-ofp-actions | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions -index c7858bd..4d05ef9 100755 ---- a/build-aux/extract-ofp-actions -+++ b/build-aux/extract-ofp-actions -@@ -35,7 +35,7 @@ line = "" - arg_structs = set() - - def round_up(x, y): -- return (x + (y - 1)) / y * y -+ return int((x + (y - 1)) / y) * y - - def open_file(fn): - global file_name diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch deleted file mode 100644 index 753490f81..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch +++ /dev/null @@ -1,49 +0,0 @@ -From c78b39ae9ba6337210d6a9e4ccc4753cb1c3b48f Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Thu, 29 Jun 2017 20:33:23 -0700 -Subject: [PATCH] Python3 compatibility: unicode to str - -Commit 7430959d4ad17db89b8387c3aef58c8b230cad10 from -https://github.com/openvswitch/ovs.git - -When transitioning from python2 to python3 the following type class -changes occured: - -python2 -> python3 -unicode -> str -str -> bytes - -That means we have to check the python version and do the right type -check python3 will throw an error when it tries to use the unicode -type because it doesn't exist. - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Ben Pfaff <blp@ovn.org> - ---- - ovsdb/ovsdb-doc | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc -index 9448713..d55c6e6 100755 ---- a/ovsdb/ovsdb-doc -+++ b/ovsdb/ovsdb-doc -@@ -65,9 +65,15 @@ def columnGroupToNroff(table, groupXml, documented_columns): - if node.hasAttribute('type'): - type_string = node.attributes['type'].nodeValue - type_json = ovs.json.from_string(str(type_string)) -- if type(type_json) in (str, unicode): -- raise error.Error("%s %s:%s has invalid 'type': %s" -- % (table.name, name, key, type_json)) -+ # py2 -> py3 means str -> bytes and unicode -> str -+ try: -+ if type(type_json) in (str, unicode): -+ raise error.Error("%s %s:%s has invalid 'type': %s" -+ % (table.name, name, key, type_json)) -+ except: -+ if type(type_json) in (bytes, str): -+ raise error.Error("%s %s:%s has invalid 'type': %s" -+ % (table.name, name, key, type_json)) - type_ = ovs.db.types.BaseType.from_json(type_json) - else: - type_ = column.type.value diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0008-AUTHORS-Add-Jason-Wessel.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0008-AUTHORS-Add-Jason-Wessel.patch deleted file mode 100644 index f55a5caf5..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0008-AUTHORS-Add-Jason-Wessel.patch +++ /dev/null @@ -1,26 +0,0 @@ -From f8491645416952b31000f42777ff79486a7b0511 Mon Sep 17 00:00:00 2001 -From: Ben Pfaff <blp@ovn.org> -Date: Thu, 6 Jul 2017 14:01:27 -0700 -Subject: [PATCH] AUTHORS: Add Jason Wessel. - -Commit a91c4cfaf863718bc94fb9c88939bd0b0385a6fe from -https://github.com/openvswitch/ovs.git - -Signed-off-by: Ben Pfaff <blp@ovn.org> - ---- - AUTHORS.rst | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/AUTHORS.rst b/AUTHORS.rst -index 63e6a8d..d0dc70d 100644 ---- a/AUTHORS.rst -+++ b/AUTHORS.rst -@@ -156,6 +156,7 @@ Jan Scheurich jan.scheurich@ericsson.com - Jan Vansteenkiste jan@vstone.eu - Jarno Rajahalme jarno@ovn.org - Jason Kölker jason@koelker.net -+Jason Wessel jason.wessel@windriver.com - Jasper Capel jasper@capel.tv - Jean Tourrilhes jt@hpl.hp.com - Jeremy Stribling strib@nicira.com diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch deleted file mode 100644 index 5c86aacc5..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch +++ /dev/null @@ -1,24 +0,0 @@ -From f675d7209f999ce80cb4249c4ebb216697387b71 Mon Sep 17 00:00:00 2001 -From: Amy Fong <amy.fong@windriver.com> -Date: Thu, 29 Jan 2015 09:56:03 -0500 -Subject: [PATCH] Disable m4 file test where sources are built from git. - -Signed-off-by: Amy Fong <amy.fong@windriver.com> - ---- - Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.am b/Makefile.am -index ff7d70a..2fc1f13 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -189,7 +189,7 @@ CLEAN_LOCAL += clean-pycov - # Makefile in datapath/linux, needed to get the list of files to - # distribute, requires GNU make extensions. - if GNU_MAKE --ALL_LOCAL += dist-hook-git -+# ALL_LOCAL += dist-hook-git - dist-hook-git: distfiles - @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \ - (cd datapath && $(MAKE) distfiles); \ diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch deleted file mode 100644 index c177202fa..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch +++ /dev/null @@ -1,26 +0,0 @@ -From adfd2380d71dff1a31efaf63cf7ac97470466ec9 Mon Sep 17 00:00:00 2001 -From: Amy Fong <amy.fong@windriver.com> -Date: Thu, 29 Jan 2015 09:56:03 -0500 -Subject: [PATCH] Specify install path for kernel module - -Signed-off-by: Amy Fong <amy.fong@windriver.com> - ---- - datapath/linux/Makefile.main.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/datapath/linux/Makefile.main.in b/datapath/linux/Makefile.main.in -index 7d18253..63c520f 100644 ---- a/datapath/linux/Makefile.main.in -+++ b/datapath/linux/Makefile.main.in -@@ -71,8 +71,8 @@ default: - $(MAKE) -C $(KSRC) M=$(builddir) modules - - modules_install: -- $(MAKE) -C $(KSRC) M=$(builddir) modules_install -- depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h` -+ $(MAKE) -C $(KSRC) M=$(builddir) modules_install INSTALL_MOD_PATH=${INSTALL_MOD_PATH} -+ # depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h` - endif - - # Much of the kernel build system in this file is derived from Intel's diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-b8dcfbebee9e7dbc74ec5eecc9b45d335d6150c1.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-b8dcfbebee9e7dbc74ec5eecc9b45d335d6150c1.patch deleted file mode 100644 index 4ae86c381..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-b8dcfbebee9e7dbc74ec5eecc9b45d335d6150c1.patch +++ /dev/null @@ -1,108 +0,0 @@ -From fb68120ef8aed625b04b2fbd2cb78fc59a7b7432 Mon Sep 17 00:00:00 2001 -From: He Zhe <zhe.he@windriver.com> -Date: Wed, 30 Mar 2016 06:23:45 -0400 -Subject: [PATCH] openvswitch: Add test-install rule to support ptest execution - -Signed-off-by: Radu Patriu <radu.patriu@enea.com> - -Fix ptest for v2.5 - - Copy certain files from srcdir since it has been different from - build directory. - - Copy more necessary files for new added test cases. - - Modify config files for running on target. - -Signed-off-by: He Zhe <zhe.he@windriver.com> - ---- - Makefile.am | 1 + - test.mk | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 73 insertions(+) - create mode 100644 test.mk - -diff --git a/Makefile.am b/Makefile.am -index ea63acb..ff7d70a 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -429,3 +429,4 @@ include windows/automake.mk - include ovn/automake.mk - include selinux/automake.mk - include build-aux/automake.mk -+include test.mk -diff --git a/test.mk b/test.mk -new file mode 100644 -index 0000000..b10a581 ---- /dev/null -+++ b/test.mk -@@ -0,0 +1,72 @@ -+TEST_DEST ?= ${prefix}/lib/openvswitch -+TEST_ROOT ?= ${prefix}/lib/openvswitch -+TEST_DEPEND = -+ -+if HAVE_OPENSSL -+TEST_DEPEND += $(TESTPKI_FILES) -+endif -+ -+test-install: $(TEST_DEPEND) -+ @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\ -+ install -d $(TEST_DEST)/tests ;\ -+ install $(srcdir)/vtep/ovs-vtep $(TEST_DEST)/tests ;\ -+ install -d $(TEST_DEST)/python ;\ -+ install -d $(TEST_DEST)/python/ovs ;\ -+ install -d $(TEST_DEST)/python/ovs/db ;\ -+ install -d $(TEST_DEST)/python/ovs/unixctl ;\ -+ install -d $(TEST_DEST)/vswitchd ;\ -+ install $(srcdir)/vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\ -+ install vswitchd/ovs-vswitchd $(TEST_DEST)/vswitchd ;\ -+ install -d $(TEST_DEST)/debian ;\ -+ install $(srcdir)/debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\ -+ install -d $(TEST_DEST)/build-aux ;\ -+ install $(srcdir)/build-aux/check-structs $(TEST_DEST)/build-aux ;\ -+ install -d $(TEST_DEST)/xenserver ;\ -+ install $(srcdir)/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\ -+ install $(srcdir)/xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\ -+ install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\ -+ install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\ -+ install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\ -+ install -d $(TEST_DEST)/vtep ;\ -+ install $(srcdir)/vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\ -+ install -d $(TEST_DEST)/ovn ;\ -+ install $(srcdir)/ovn/ovn-nb.ovsschema $(TEST_DEST)/ovn ;\ -+ install $(srcdir)/ovn/ovn-sb.ovsschema $(TEST_DEST)/ovn ;\ -+ install -d $(TEST_DEST)/utilities ;\ -+ install $(srcdir)/utilities/ovs-pcap.in $(TEST_DEST)/utilities ;\ -+ install $(srcdir)/utilities/ovs-pki.in $(TEST_DEST)/utilities ;\ -+ for p in $$list ; do \ -+ echo $$p ;\ -+ p=$${p#../git/} ;\ -+ pre=$${p#tests\/} ;\ -+ if test $$pre != $$p ; then \ -+ echo installing $$p to $(TEST_DEST)/tests/$$pre ;\ -+ if test -f $$p ; then \ -+ install $$p $(TEST_DEST)/tests/$$pre ;\ -+ else \ -+ install $(srcdir)/$$p $(TEST_DEST)/tests/$$pre ;\ -+ fi ;\ -+ continue ;\ -+ fi ;\ -+ pre=$${p#python\/ovs\/} ;\ -+ if test $$pre != $$p ; then \ -+ echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\ -+ if test -f $$p ; then \ -+ install $$p $(TEST_DEST)/python/ovs/$$pre ;\ -+ else \ -+ install $(srcdir)/$$p $(TEST_DEST)/python/ovs/$$pre ;\ -+ fi ;\ -+ continue ;\ -+ fi; \ -+ done ;\ -+ sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|at_srcdir=.*|at_srcdir='"'"'.'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|at_top_srcdir=.*|at_top_srcdir='"'"'..'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|at_top_build_prefix=.*|at_top_build_prefix='"'"'../'"'"'|g' $(TEST_DEST)/tests/atconfig -+ sed -i 's|^\(.*config\.log.*\)|#\1|g' $(TEST_DEST)/tests/testsuite -+ sed -i 's|$$srcdir|$$abs_srcdir|g' $(TEST_DEST)/tests/testsuite -+ sed -i 's|ovs-appctl-bashcomp\.bash|/etc/bash_completion.d/ovs-appctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite -+ sed -i 's|ovs-vsctl-bashcomp\.bash|/etc/bash_completion.d/ovs-vsctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc deleted file mode 100644 index 58e0fcb07..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc +++ /dev/null @@ -1,153 +0,0 @@ -SUMMARY = "OpenvSwitch" -DESCRIPTION = "\ - Open vSwitch is a production quality, multilayer virtual switch \ - licensed under the open source Apache 2.0 license. It is designed \ - to enable massive network automation through programmatic extension, \ - while still supporting standard management interfaces and protocols \ - (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag) \ - " - -HOMEPAGE = "http://openvswitch.org/" -SECTION = "networking" -LICENSE = "Apache-2" - -DEPENDS += "bridge-utils openssl python3 perl python3-six-native coreutils-native" - -RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \ - python3 perl perl-module-strict ${PN}-switch \ - bash python3-twisted python3-six" -RDEPENDS_${PN}-testcontroller = "${PN} lsb ${PN}-pki" -RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen" -RDEPENDS_${PN}-pki = "${PN}" -RDEPENDS_${PN}-brcompat = "${PN} ${PN}-switch" - -# Some installers will fail because of an install order based on -# rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be -# queued for install later. -RDEPENDS_${PN} += "sed gawk grep" - -SRC_URI = "\ - file://openvswitch-switch \ - file://openvswitch-switch-setup \ - file://openvswitch-testcontroller \ - file://openvswitch-testcontroller-setup \ - " - -EXTRA_OECONF += "\ - PYTHON=python3 \ - PYTHON3=python3 \ - PERL=${bindir}/perl \ - " -CONFIGUREOPT_DEPTRACK = "" - -# Don't compile kernel modules by default since it heavily depends on -# kernel version. Use the in-kernel module for now. -# distro layers can enable with EXTRA_OECONF_pn_openvswitch += "" -# EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}" - -ALLOW_EMPTY_${PN}-pki = "1" -PACKAGES =+ "${PN}-testcontroller ${PN}-switch ${PN}-brcompat ${PN}-pki" - -FILES_${PN}-testcontroller = "\ - ${sysconfdir}/init.d/openvswitch-testcontroller \ - ${sysconfdir}/default/openvswitch-testcontroller \ - ${sysconfdir}/openvswitch-testcontroller \ - ${bindir}/ovs-testcontroller \ - " - -FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd" - -FILES_${PN}-switch = "\ - ${sysconfdir}/init.d/openvswitch-switch \ - ${sysconfdir}/default/openvswitch-switch \ - ${systemd_unitdir}/system/ovs-vswitchd.service \ - ${systemd_unitdir}/system/openvswitch.service \ - ${systemd_unitdir}/system/ovsdb-server.service \ - " - -# silence a warning -FILES_${PN} += "${datadir}/ovsdbmonitor" -FILES_${PN} += "/run" - -FILES_${PN} += "${libdir}/python${PYTHON_BASEVERSION}/" -inherit autotools update-rc.d systemd python3native - -SYSTEMD_PACKAGES = "${PN}-switch" -SYSTEMD_SERVICE_${PN}-switch = " \ - ovsdb-server.service \ - ovs-vswitchd.service \ - openvswitch.service \ -" - -INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-testcontroller" -INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch" -INITSCRIPT_PARAMS_${PN}-switch = "defaults 71" - -INITSCRIPT_NAME_${PN}-testcontroller = "openvswitch-testcontroller" -INITSCRIPT_PARAMS_${PN}-testcontroller = "defaults 72" - -do_configure_prepend() { - # Work around the for Makefile CC=$(if ....) by swapping out any - # "-Wa," assembly directives with "-Xassembler - CC=`echo '${CC}' | sed 's/-Wa,/-Xassembler /g'` -} - -do_install_append() { - install -d ${D}/${sysconfdir}/default/ - install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch - install -d ${D}/${sysconfdir}/openvswitch-testcontroller - install -m 660 ${WORKDIR}/openvswitch-testcontroller-setup ${D}/${sysconfdir}/default/openvswitch-testcontroller - - install -d ${D}/${sysconfdir}/init.d/ - install -m 755 ${WORKDIR}/openvswitch-testcontroller ${D}/${sysconfdir}/init.d/openvswitch-testcontroller - install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch - true || rm -fr ${D}/${datadir}/${PN}/pki - - install -d ${D}/${systemd_unitdir}/system/ - install -m 644 ${S}/rhel/usr_lib_systemd_system_ovs-vswitchd.service \ - ${D}/${systemd_unitdir}/system/ovs-vswitchd.service - install -m 644 ${S}/rhel/usr_lib_systemd_system_openvswitch.service \ - ${D}/${systemd_unitdir}/system/openvswitch.service - install -m 644 ${S}/rhel/usr_lib_systemd_system_ovsdb-server.service \ - ${D}/${systemd_unitdir}/system/ovsdb-server.service - - oe_runmake modules_install INSTALL_MOD_PATH=${D} - install -d ${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages - cp -r ${S}/python/ovstest/ ${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages/ -} - -pkg_postinst_${PN}-pki () { - # can't do this offline - if [ "x$D" != "x" ]; then - exit 1 - fi - if test ! -d $D/${datadir}/${PN}/pki; then - ovs-pki init --dir=$D/${datadir}/${PN}/pki - fi -} - -pkg_postinst_${PN}-testcontroller () { - # can't do this offline - if [ "x$D" != "x" ]; then - exit 1 - fi - - if test ! -d $D/${datadir}/${PN}/pki; then - ovs-pki init --dir=$D/${datadir}/${PN}/pki - fi - - cd $D/${sysconfdir}/openvswitch-testcontroller - if ! test -e cacert.pem; then - ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem - fi - if ! test -e privkey.pem || ! test -e cert.pem; then - oldumask=$(umask) - umask 077 - ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null - mv tmp-privkey.pem privkey.pem - mv tmp-cert.pem cert.pem - mv tmp-req.pem req.pem - chmod go+r cert.pem req.pem - umask $oldumask - fi -} diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb deleted file mode 100644 index c3a830191..000000000 --- a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb +++ /dev/null @@ -1,75 +0,0 @@ -require openvswitch.inc - -DEPENDS += "virtual/kernel" - -RDEPENDS_${PN}-ptest += "\ - python3-logging python3-syslog python3-io \ - python3-fcntl python3-shell python3-xml python3-math \ - python3-datetime python3-netclient python3 sed \ - ldd perl-module-socket perl-module-carp perl-module-exporter \ - perl-module-xsloader python3-netserver python3-threading \ - python3-resource findutils which \ - " - -S = "${WORKDIR}/git" -PV = "2.7.3+${SRCREV}" - -FILESEXTRAPATHS_append := "${THISDIR}/${PN}-git:" - -SRCREV = "b8dcfbebee9e7dbc74ec5eecc9b45d335d6150c1" -SRC_URI = "file://openvswitch-switch \ - file://openvswitch-switch-setup \ - file://openvswitch-testcontroller \ - file://openvswitch-testcontroller-setup \ - git://github.com/openvswitch/ovs.git;protocol=git;branch=branch-2.7 \ - file://openvswitch-add-ptest-${SRCREV}.patch \ - file://run-ptest \ - file://disable_m4_check.patch \ - file://kernel_module.patch \ - file://python-make-remaining-scripts-use-usr-bin-env.patch \ - file://0001-use-the-linux-if_packet.h-Interface-directly.patch \ - file://0002-Define-WAIT_ANY-if-not-provided-by-system.patch \ - file://python-switch-remaining-scripts-to-use-python3.patch \ - " - -# Temporarily backport patches to better support py3. These have been -# merged upstream but are not part of v2.7.1. -SRC_URI += " \ - file://0001-Python3-compatibility-Convert-print-statements.patch \ - file://0002-Python3-compatibility-exception-cleanup.patch \ - file://0003-Python3-compatibility-execfile-to-exec.patch \ - file://0004-Python3-compatibility-iteritems-to-items.patch \ - file://0005-Python3-compatibility-fix-integer-problems.patch \ - file://0006-Python3-compatibility-math-error-compatibility.patch \ - file://0007-Python3-compatibility-unicode-to-str.patch \ - file://0008-AUTHORS-Add-Jason-Wessel.patch \ -" - -LIC_FILES_CHKSUM = "file://COPYING;md5=17b2c9d4c70853a09c0e143137754b35" - -DPDK_INSTALL_DIR ?= "/opt/dpdk" - -PACKAGECONFIG ?= "libcap-ng" -PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}${DPDK_INSTALL_DIR}/share/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk,dpdk" -PACKAGECONFIG[libcap-ng] = "--enable-libcapng,--disable-libcapng,libcap-ng," - -# Don't compile kernel modules by default since it heavily depends on -# kernel version. Use the in-kernel module for now. -# distro layers can enable with EXTRA_OECONF_pn_openvswitch += "" -# EXTRA_OECONF += "--with-linux=${STAGING_KERNEL_BUILDDIR} --with-linux-source=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}" - -# silence a warning -FILES_${PN} += "/lib/modules" - -inherit ptest - -EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}" - -do_install_ptest() { - oe_runmake test-install -} - -do_install_append() { - oe_runmake modules_install INSTALL_MOD_PATH=${D} - rm -r ${D}/${localstatedir}/run -} |