From patchwork Wed Sep 18 23:33:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1164305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Yg3Y5kkdz9s7T for ; Thu, 19 Sep 2019 11:58:01 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 77EF7100D; Thu, 19 Sep 2019 01:57:58 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 2ADD2F8F for ; Thu, 19 Sep 2019 01:57:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B14BB81A for ; Thu, 19 Sep 2019 01:57:55 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 70CF61BF204; Thu, 19 Sep 2019 01:57:53 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 18 Sep 2019 16:33:17 -0700 Message-Id: <20190918233322.24305-2-blp@ovn.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918233322.24305-1-blp@ovn.org> References: <20190918233322.24305-1-blp@ovn.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 python3 1/6] travis: Obtain testsuite logs from the correct directory. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org These days Automake uses _build/sub for its distcheck builds, not plain _build. (I don't know whether that is a change from previous versions.) Signed-off-by: Ben Pfaff --- .travis/linux-build.sh | 2 +- .travis/osx-build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index 1577ae51659d..661d5e89ed70 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -172,7 +172,7 @@ if [ "$TESTSUITE" ]; then export DISTCHECK_CONFIGURE_FLAGS="$OPTS" if ! make distcheck TESTSUITEFLAGS=-j4 RECHECK=yes; then # testsuite.log is necessary for debugging. - cat */_build/tests/testsuite.log + cat */_build/sub/tests/testsuite.log exit 1 fi else diff --git a/.travis/osx-build.sh b/.travis/osx-build.sh index f11d7b9af5d6..909173061a71 100755 --- a/.travis/osx-build.sh +++ b/.travis/osx-build.sh @@ -20,7 +20,7 @@ fi if [ "$TESTSUITE" ] && [ "$CC" != "clang" ]; then if ! make distcheck RECHECK=yes; then # testsuite.log is necessary for debugging. - cat */_build/tests/testsuite.log + cat */_build/sub/tests/testsuite.log exit 1 fi fi From patchwork Wed Sep 18 23:33:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1164307 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Yg4v3bZDz9s7T for ; Thu, 19 Sep 2019 11:59:11 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id DE7451023; Thu, 19 Sep 2019 01:58:01 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id CEE1E1014 for ; Thu, 19 Sep 2019 01:57:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 402EC76D for ; Thu, 19 Sep 2019 01:57:58 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id DB7311BF205; Thu, 19 Sep 2019 01:57:54 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 18 Sep 2019 16:33:18 -0700 Message-Id: <20190918233322.24305-3-blp@ovn.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918233322.24305-1-blp@ovn.org> References: <20190918233322.24305-1-blp@ovn.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 python3 2/6] travis: Dump config.log if make fails. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This is sometimes useful for debugging. Signed-off-by: Ben Pfaff --- .travis/linux-build.sh | 2 +- .travis/osx-build.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index 661d5e89ed70..89496e2a275b 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -132,7 +132,7 @@ function build_ovs() make -j4 popd else - make -j4 + make -j4 || { cat config.log; exit 1; } fi } diff --git a/.travis/osx-build.sh b/.travis/osx-build.sh index 909173061a71..bf2c13fa3c1a 100755 --- a/.travis/osx-build.sh +++ b/.travis/osx-build.sh @@ -13,9 +13,13 @@ function configure_ovs() configure_ovs $EXTRA_OPTS $* if [ "$CC" = "clang" ]; then - make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument" + set make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument" else - make CFLAGS="$CFLAGS $BUILD_ENV" + set make CFLAGS="$CFLAGS $BUILD_ENV" +fi +if ! "$@"; then + cat config.log + exit 1 fi if [ "$TESTSUITE" ] && [ "$CC" != "clang" ]; then if ! make distcheck RECHECK=yes; then From patchwork Wed Sep 18 23:33:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1164308 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Yg5f6Q1wz9s7T for ; Thu, 19 Sep 2019 11:59:50 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 8C407103E; Thu, 19 Sep 2019 01:58:09 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 425121036 for ; Thu, 19 Sep 2019 01:58:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A993581A for ; Thu, 19 Sep 2019 01:58:07 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 1E81F1BF203; Thu, 19 Sep 2019 01:57:57 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 18 Sep 2019 16:33:19 -0700 Message-Id: <20190918233322.24305-4-blp@ovn.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918233322.24305-1-blp@ovn.org> References: <20190918233322.24305-1-blp@ovn.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 python3 3/6] Documentation: Work with sphinx-build for Python 3 also. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org There's nothing in OVS specific to Sphinx for Python 2, but the compile-time check only looked for a binary named "sphinx-build", which is typically provided only for Python 2. With Python 3, the binary is typically called "sphinx-build-3". With this commit, either name is accepted. Signed-off-by: Ben Pfaff --- Documentation/automake.mk | 1 - m4/openvswitch.m4 | 13 ++++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Documentation/automake.mk b/Documentation/automake.mk index cd68f3b1571e..e1384851d330 100644 --- a/Documentation/automake.mk +++ b/Documentation/automake.mk @@ -115,7 +115,6 @@ EXTRA_DIST += $(DOC_SOURCE) # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = sphinx-build SPHINXSRCDIR = $(srcdir)/Documentation SPHINXBUILDDIR = $(builddir)/Documentation/_build diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index cd6b51d86c16..4379d16b4203 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -474,15 +474,10 @@ AC_DEFUN([OVS_CHECK_FLAKE8], dnl Checks for sphinx. AC_DEFUN([OVS_CHECK_SPHINX], - [AC_CACHE_CHECK( - [for sphinx], - [ovs_cv_sphinx], - [if type sphinx-build >/dev/null 2>&1; then - ovs_cv_sphinx=yes - else - ovs_cv_sphinx=no - fi]) - AM_CONDITIONAL([HAVE_SPHINX], [test "$ovs_cv_sphinx" = yes])]) + [AC_CHECK_PROGS( + [SPHINXBUILD], [sphinx-build-3 sphinx-build-2 sphinx-build], [none]) + AC_ARG_VAR([SPHINXBUILD]) + AM_CONDITIONAL([HAVE_SPHINX], [test "$ac_cv_prog_SPHINXBUILD" != none])]) dnl Checks for dot. AC_DEFUN([OVS_CHECK_DOT], From patchwork Wed Sep 18 23:33:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1164310 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Yg7348NBz9s7T for ; Thu, 19 Sep 2019 12:01:03 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EBC6C1059; Thu, 19 Sep 2019 01:59:01 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id DD788104F for ; Thu, 19 Sep 2019 01:59:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6B67E8A8 for ; Thu, 19 Sep 2019 01:58:23 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 302E31BF203; Thu, 19 Sep 2019 01:58:08 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 18 Sep 2019 16:33:20 -0700 Message-Id: <20190918233322.24305-5-blp@ovn.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918233322.24305-1-blp@ovn.org> References: <20190918233322.24305-1-blp@ovn.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 python3 4/6] Recommend Sphinx from Python 3 in documentation and packaging. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Signed-off-by: Ben Pfaff --- .travis.yml | 2 +- Documentation/intro/install/documentation.rst | 6 +++--- Documentation/intro/install/rhel.rst | 2 +- rhel/openvswitch-fedora.spec.in | 2 +- rhel/openvswitch.spec.in | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 370b3d0a6c98..68026312ba84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ addons: - libjemalloc1 - libjemalloc-dev - libnuma-dev - - python-sphinx + - python3-sphinx - libelf-dev - selinux-policy-dev - libunbound-dev diff --git a/Documentation/intro/install/documentation.rst b/Documentation/intro/install/documentation.rst index d7eb25d9ef06..acf5b3a3ff33 100644 --- a/Documentation/intro/install/documentation.rst +++ b/Documentation/intro/install/documentation.rst @@ -45,11 +45,11 @@ Sphinx. A detailed guide on installing Sphinx in many environments is available on the `Sphinx website`__ but, for most Linux distributions, you can install with your package manager. For example, on Debian/Ubuntu run:: - $ sudo apt-get install python-sphinx + $ sudo apt-get install python3-sphinx Similarly, on RHEL/Fedora run:: - $ sudo dnf install python-sphinx + $ sudo dnf install python3-sphinx A ``requirements.txt`` is also provided in the ``/Documentation``, should you wish to install using ``pip``:: @@ -71,7 +71,7 @@ available on the `Sphinx website`__. Building -------- -Once Sphinx installed, the documentation can be built using the provided +Once Sphinx is installed, the documentation can be built using the provided Makefile targets:: $ make docs-check diff --git a/Documentation/intro/install/rhel.rst b/Documentation/intro/install/rhel.rst index 6f062e89446a..0e5ca2743ef5 100644 --- a/Documentation/intro/install/rhel.rst +++ b/Documentation/intro/install/rhel.rst @@ -89,7 +89,7 @@ And to install specific dependencies, use yum-builddep tool:: Once that is completed, remove the file ``/tmp/ovs.spec``. -If python-sphinx package is not available in your version of RHEL, you can +If python3-sphinx package is not available in your version of RHEL, you can install it via pip with 'pip install sphinx'. Open vSwitch requires python 2.7 or newer which is not available in older diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index 9c752ff4ed4e..9c407123296a 100644 --- a/rhel/openvswitch-fedora.spec.in +++ b/rhel/openvswitch-fedora.spec.in @@ -79,7 +79,7 @@ BuildRequires: python3-devel BuildRequires: desktop-file-utils BuildRequires: groff graphviz BuildRequires: checkpolicy, selinux-policy-devel -BuildRequires: /usr/bin/sphinx-build +BuildRequires: /usr/bin/sphinx3-build # make check dependencies BuildRequires: %{_py2}-twisted%{?rhel:-core} %{_py2}-zope-interface %{_py2}-six BuildRequires: procps-ng diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in index c8361f5f29ff..7f27fedd6886 100644 --- a/rhel/openvswitch.spec.in +++ b/rhel/openvswitch.spec.in @@ -37,7 +37,7 @@ BuildRequires: python-six BuildRequires: openssl-devel BuildRequires: checkpolicy, selinux-policy-devel BuildRequires: autoconf, automake, libtool -BuildRequires: python-sphinx +BuildRequires: python3-sphinx BuildRequires: unbound-devel %bcond_without check From patchwork Wed Sep 18 23:33:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1164309 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Yg6T3bKXz9sNF for ; Thu, 19 Sep 2019 12:00:33 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 4B4931050; Thu, 19 Sep 2019 01:59:01 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id D1E7D103C for ; Thu, 19 Sep 2019 01:59:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B3D948B4 for ; Thu, 19 Sep 2019 01:58:26 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id A26591BF205; Thu, 19 Sep 2019 01:58:23 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 18 Sep 2019 16:33:21 -0700 Message-Id: <20190918233322.24305-6-blp@ovn.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918233322.24305-1-blp@ovn.org> References: <20190918233322.24305-1-blp@ovn.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 python3 5/6] xenserver: Make Python files parse in Python 3 also. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org I don't actually have any idea whether XenServer has moved forward to Python 3 these days, but these files are still OK in Python 2.x as well. The rest of the Python files in OVS seem to already be OK in Python 3. Signed-off-by: Ben Pfaff --- ...xensource_libexec_InterfaceReconfigureBridge.py | 10 +++++----- ..._lib_xsconsole_plugins-base_XSFeatureVSwitch.py | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py index a93e438667de..5cc22319a9eb 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py @@ -65,7 +65,7 @@ def load_bonding_driver(): f = open(sysfs_bonding_masters, "w") f.write("-bond0") f.close() - except IOError, e: + except IOError as e: log("Failed to load bonding driver: %s" % e) def bonding_driver_loaded(): @@ -92,7 +92,7 @@ def __create_bond_device(name): f = open(sysfs_bonding_masters, "w") f.write("+" + name) f.close() - except IOError, e: + except IOError as e: log("Failed to create %s: %s" % (name, e)) def create_bond_device(pif): @@ -114,7 +114,7 @@ def __destroy_bond_device(name): f.write("-" + name) f.close() retries = 0 - except IOError, e: + except IOError as e: time.sleep(0.5) else: log("bond master %s does not exist, not destroying" % name) @@ -355,8 +355,8 @@ def _configure_bond_interface(pif): # override defaults with values from other-config whose keys being with "bond-" oc = pifrec['other_config'] - overrides = filter(lambda (key,val): key.startswith("bond-"), oc.items()) - overrides = map(lambda (key,val): (key[5:], val), overrides) + overrides = filter(lambda key,val: key.startswith("bond-"), oc.items()) + overrides = map(lambda key,val: (key[5:], val), overrides) bond_options.update(overrides) # write the bond options to ifcfg-bondX diff --git a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py index fdbbc0ed4c89..8946917d526e 100644 --- a/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py +++ b/xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py @@ -39,7 +39,7 @@ class VSwitchService: def version(self): try: output = ShellPipe(["service", self.name, "version"]).Stdout() - except StandardError, e: + except StandardError as e: XSLogError("vswitch version retrieval error: " + str(e)) return "" for line in output: @@ -50,7 +50,7 @@ class VSwitchService: def status(self): try: output = ShellPipe(["service", self.name, "status"]).Stdout() - except StandardError, e: + except StandardError as e: XSLogError("vswitch status retrieval error: " + str(e)) return "" if len(output) == 0: @@ -69,7 +69,7 @@ class VSwitchService: def restart(self): try: ShellPipe(["service", self.name, "restart"]).Call() - except StandardError, e: + except StandardError as e: XSLogError("vswitch restart error: " + str(e)) @classmethod @@ -88,7 +88,7 @@ class VSwitchConfig: try: arg = [vsctl, "-vconsole:off"] + action.split() output = ShellPipe(arg).Stdout() - except StandardError, e: + except StandardError as e: XSLogError("config retrieval error: " + str(e)) return "" @@ -189,7 +189,7 @@ class VSwitchControllerDialogue(Dialogue): try: self.SetController(self.controller) Layout.Inst().PushDialogue(InfoDialogue(Lang("Setting controller successful"))) - except Exception, e: + except Exception as e: Layout.Inst().PushDialogue(InfoDialogue(Lang("Setting controller failed"))) self.ChangeState("INITIAL") @@ -213,7 +213,7 @@ class VSwitchControllerDialogue(Dialogue): try: self.SetController(None) Layout.Inst().PushDialogue(InfoDialogue(Lang("Controller deletion successful"))) - except Exception, e: + except Exception as e: Layout.Inst().PushDialogue(InfoDialogue(Lang("Controller deletion failed"))) def syncController(self): @@ -222,7 +222,7 @@ class VSwitchControllerDialogue(Dialogue): try: Task.Sync(lambda s: self._updateThisServer(s)) Layout.Inst().PushDialogue(InfoDialogue(Lang("Resyncing controller config successful"))) - except Exception, e: + except Exception as e: Layout.Inst().PushDialogue(InfoDialogue(Lang("Resyncing controller config failed"))) def SetController(self, ip): From patchwork Wed Sep 18 23:33:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1164311 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Yg7k6fPjz9s7T for ; Thu, 19 Sep 2019 12:01:38 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id ED362107B; Thu, 19 Sep 2019 01:59:17 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 34D261058 for ; Thu, 19 Sep 2019 01:59:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AEBBC8BC for ; Thu, 19 Sep 2019 01:58:36 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id B5DA51BF207; Thu, 19 Sep 2019 01:58:26 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 18 Sep 2019 16:33:22 -0700 Message-Id: <20190918233322.24305-7-blp@ovn.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918233322.24305-1-blp@ovn.org> References: <20190918233322.24305-1-blp@ovn.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, URI_NOVOWEL,WEIRD_QUOTING autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 python3 6/6] Require Python 3 and remove support for Python 2. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Python 2 reaches end-of-life on January 1, 2020, which is only a few months away. This means that OVS needs to stop depending on in the next release that should occur roughly that same time. Therefore, this commit removes all support for Python 2. It also makes Python 3 a mandatory build dependency. Some of the interesting consequences: - HAVE_PYTHON, HAVE_PYTHON2, and HAVE_PYTHON3 conditionals have been removed, since we now know that Python3 is available. - $PYTHON and $PYTHON2 are removed, and $PYTHON3 is always available. - Many tests for Python 2 support have been removed, and the ones that depended on Python 3 now run unconditionally. This allowed several macros in the testsuite to be removed, making the code clearer. This does make some of the changes to the testsuite files large due to indentation level changes. - #! lines for Python now use /usr/bin/python3 instead of /usr/bin/python. - Packaging depends on Python 3 packages. --- .cirrus.yml | 3 +- .travis/osx-prepare.sh | 4 +- Documentation/intro/install/fedora.rst | 4 +- Documentation/intro/install/general.rst | 8 +- Documentation/intro/install/netbsd.rst | 10 +- Documentation/intro/install/rhel.rst | 2 +- Documentation/intro/install/windows.rst | 4 +- Documentation/intro/install/xenserver.rst | 4 +- Makefile.am | 12 +- Vagrantfile | 24 +- Vagrantfile-FreeBSD | 2 +- appveyor.yml | 2 +- build-aux/check-structs | 2 +- build-aux/dpdkstrip.py | 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/sodepends.py | 2 +- build-aux/soexpand.py | 2 +- build-aux/text2c | 2 +- build-aux/xml2nroff | 2 +- configure.ac | 3 +- debian/.gitignore | 1 + debian/automake.mk | 4 +- debian/control | 35 +- debian/openvswitch-test.install | 2 +- debian/python-openvswitch.install | 1 - ...nvswitch.dirs => python3-openvswitch.dirs} | 0 debian/python3-openvswitch.install | 1 + debian/rules | 2 +- include/openflow/automake.mk | 2 - ipsec/ovs-monitor-ipsec.in | 2 +- m4/openvswitch.m4 | 101 +--- manpages.mk | 6 - ovn/automake.mk | 8 +- ovsdb/ovsdb-dot.in | 2 +- ovsdb/ovsdb-idlc.in | 2 +- python/automake.mk | 9 +- tests/atlocal.in | 42 +- tests/automake.mk | 2 +- tests/check-structs.at | 3 +- tests/checkpatch.at | 17 +- tests/daemon-py.at | 453 ++++++++---------- tests/flowgen.py | 2 +- tests/interface-reconfigure.at | 2 +- tests/json.at | 57 +-- tests/jsonrpc-py.at | 67 +-- tests/library.at | 42 +- tests/ofproto-dpif.at | 10 +- tests/ofproto.at | 4 +- tests/ovs-macros.at | 2 +- tests/ovs-xapi-sync.at | 3 +- tests/ovsdb-data.at | 9 +- tests/ovsdb-idl.at | 188 ++------ tests/ovsdb-macros.at | 52 +- tests/ovsdb-monitor.at | 20 +- tests/reconnect.at | 13 +- tests/system-common-macros.at | 2 +- tests/system-kmod-macros.at | 3 +- tests/system-traffic.at | 16 +- tests/system-userspace-macros.at | 4 +- tests/unixctl-py.at | 208 ++++---- tests/vlog.at | 219 ++++----- utilities/automake.mk | 5 +- utilities/bugtool/automake.mk | 2 - utilities/bugtool/ovs-bugtool.in | 2 +- utilities/checkpatch.py | 2 +- utilities/ovs-check-dead-ifs.in | 2 +- utilities/ovs-dpctl-top.in | 2 +- utilities/ovs-l3ping.in | 2 +- utilities/ovs-parse-backtrace.in | 2 +- utilities/ovs-pcap.in | 2 +- utilities/ovs-tcpdump.in | 2 +- utilities/ovs-tcpundump.in | 2 +- utilities/ovs-test.in | 2 +- utilities/ovs-vlan-test.in | 2 +- vswitchd/automake.mk | 4 +- vtep/automake.mk | 4 +- vtep/ovs-vtep.in | 2 +- 80 files changed, 648 insertions(+), 1111 deletions(-) delete mode 100644 debian/python-openvswitch.install rename debian/{python-openvswitch.dirs => python3-openvswitch.dirs} (100%) create mode 100644 debian/python3-openvswitch.install diff --git a/.cirrus.yml b/.cirrus.yml index eb6af0a719c8..bae5a089b248 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -9,8 +9,7 @@ freebsd_build_task: env: DEPENDENCIES: automake libtool gmake gcc wget openssl - python py27-six py27-sphinx py27-openssl - python3 py36-six py36-openssl + python3 py36-six py36-openssl p36-sphinx matrix: COMPILER: gcc COMPILER: clang diff --git a/.travis/osx-prepare.sh b/.travis/osx-prepare.sh index 58ccb67cddbd..78d5bb579217 100755 --- a/.travis/osx-prepare.sh +++ b/.travis/osx-prepare.sh @@ -1,4 +1,4 @@ #!/bin/bash set -ev -pip2 install --user six -pip2 install --user --upgrade docutils +pip3 install --user six +pip3 install --user --upgrade docutils diff --git a/Documentation/intro/install/fedora.rst b/Documentation/intro/install/fedora.rst index f11d05a01041..6fe1fb5b2468 100644 --- a/Documentation/intro/install/fedora.rst +++ b/Documentation/intro/install/fedora.rst @@ -102,7 +102,7 @@ in which `./configure` was executed: $ make rpm-fedora -This will create the RPMs `openvswitch`, `python-openvswitch`, +This will create the RPMs `openvswitch`, `python3-openvswitch`, `openvswitch-test`, `openvswitch-devel` and `openvswitch-debuginfo`. To enable DPDK support in the openvswitch package, the ``--with dpdk`` option @@ -151,7 +151,7 @@ Refer to the :doc:`/faq/index` for more information about the various Open vSwitch datapath options. In most cases only the `openvswitch` RPM will need to be installed. The -`python-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and +`python3-openvswitch`, `openvswitch-test`, `openvswitch-devel`, and `openvswitch-debuginfo` RPMs are optional unless required for a specific purpose. diff --git a/Documentation/intro/install/general.rst b/Documentation/intro/install/general.rst index b03d70f6fa6e..e62501be7fc1 100644 --- a/Documentation/intro/install/general.rst +++ b/Documentation/intro/install/general.rst @@ -90,8 +90,8 @@ need the following software: If libcap-ng is installed, then Open vSwitch will automatically build with support for it. -- Python 2.7. You must also have the Python ``six`` library version 1.4.0 - or later. +- Python 3.4 or later. You must also have the Python ``six`` library + version 1.4.0 or later. - Unbound library, from http://www.unbound.net, is optional but recommended if you want to enable ovs-vswitchd and other utilities to use DNS names when @@ -203,8 +203,8 @@ simply install and run Open vSwitch you require the following software: from iproute2 (part of all major distributions and available at https://wiki.linuxfoundation.org/networking/iproute2). -- Python 2.7. You must also have the Python six library version 1.4.0 - or later. +- Python 3.4 or later. You must also have the Python six library + version 1.4.0 or later. On Linux you should ensure that ``/dev/urandom`` exists. To support TAP devices, you must also ensure that ``/dev/net/tun`` exists. diff --git a/Documentation/intro/install/netbsd.rst b/Documentation/intro/install/netbsd.rst index 7eb7f0cebbaf..4f60dad869b6 100644 --- a/Documentation/intro/install/netbsd.rst +++ b/Documentation/intro/install/netbsd.rst @@ -31,20 +31,18 @@ you need at least the following packages. - automake - libtool-base - gmake -- python27 -- py27-six -- py27-xml +- python37 +- py37-six Some components have additional requirements. Refer to :doc:`general` for more information. -Assuming you are running NetBSD/amd64 6.1.2, you can download and install +Assuming you are running NetBSD/amd64 7.0.2, you can download and install pre-built binary packages as the following:: $ PKG_PATH=http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/7.0.2/All/ $ export PKG_PATH - $ pkg_add automake libtool-base gmake python27 py27-six py27-xml \ - pkg_alternatives + $ pkg_add automake libtool-base gmake python37 py37-six pkg_alternatives .. note:: You might get some warnings about minor version mismatch. These can be safely diff --git a/Documentation/intro/install/rhel.rst b/Documentation/intro/install/rhel.rst index 0e5ca2743ef5..17b3bc26f11d 100644 --- a/Documentation/intro/install/rhel.rst +++ b/Documentation/intro/install/rhel.rst @@ -92,7 +92,7 @@ Once that is completed, remove the file ``/tmp/ovs.spec``. If python3-sphinx package is not available in your version of RHEL, you can install it via pip with 'pip install sphinx'. -Open vSwitch requires python 2.7 or newer which is not available in older +Open vSwitch requires python 3.4 or newer which is not available in older distributions. In the case of RHEL 6.x and its derivatives, one option is to install python34 and python34-six from `EPEL`_. diff --git a/Documentation/intro/install/windows.rst b/Documentation/intro/install/windows.rst index f696d2c9b621..019e83e64425 100644 --- a/Documentation/intro/install/windows.rst +++ b/Documentation/intro/install/windows.rst @@ -56,9 +56,9 @@ The following explains the steps in some detail. 'C:/MinGW /mingw'. -- Python +- Python 3.4 or later. - Install the latest Python 2.x from python.org and verify that its path is + Install the latest Python 3.x from python.org and verify that its path is part of Windows' PATH environment variable. We require that you have Python six and pypiwin32 libraries installed. The libraries can be installed via pip command: diff --git a/Documentation/intro/install/xenserver.rst b/Documentation/intro/install/xenserver.rst index c0f5e3156697..366e11ac27ad 100644 --- a/Documentation/intro/install/xenserver.rst +++ b/Documentation/intro/install/xenserver.rst @@ -30,8 +30,8 @@ XenServer host. If you want to install Open vSwitch on a generic Linux or BSD host, refer to :doc:`general` instead. Open vSwitch should work with XenServer 5.6.100 and later. However, Open -vSwitch requires Python 2.7 or later, so using Open vSwitch with XenServer 6.5 -or earlier requires installing Python 2.7. +vSwitch requires Python 3.4 or later, so using Open vSwitch with XenServer 6.5 +or earlier requires installing Python 3.x. Building -------- diff --git a/Makefile.am b/Makefile.am index ff1f94b4841f..6030cdb495d6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,7 +60,7 @@ endif # foo/__init__.pyc will cause Python to ignore foo.py. run_python = \ PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \ - PYTHONDONTWRITEBYTECODE=yes $(PYTHON) + PYTHONDONTWRITEBYTECODE=yes $(PYTHON3) ALL_LOCAL = BUILT_SOURCES = @@ -147,13 +147,13 @@ ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer- SUFFIXES += .in .in: - $(AM_V_GEN)PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON) $(srcdir)/build-aux/soexpand.py -I$(srcdir) < $< | \ - $(PYTHON) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \ + $(AM_V_GEN)PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON3) $(srcdir)/build-aux/soexpand.py -I$(srcdir) < $< | \ + $(PYTHON3) $(srcdir)/build-aux/dpdkstrip.py $(DPDKSTRIP_FLAGS) | \ sed \ -e 's,[@]PKIDIR[@],$(PKIDIR),g' \ -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ -e 's,[@]DBDIR[@],$(DBDIR),g' \ - -e 's,[@]PYTHON[@],$(PYTHON),g' \ + -e 's,[@]PYTHON3[@],$(PYTHON3),g' \ -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ -e 's,[@]VERSION[@],$(VERSION),g' \ -e 's,[@]localstatedir[@],$(localstatedir),g' \ @@ -177,7 +177,7 @@ SUFFIXES += .xml PKIDIR='$(PKIDIR)' \ LOGDIR='$(LOGDIR)' \ DBDIR='$(DBDIR)' \ - PYTHON='$(PYTHON)' \ + PYTHON3='$(PYTHON3)' \ RUNDIR='$(RUNDIR)' \ VERSION='$(VERSION)' \ localstatedir='$(localstatedir)' \ @@ -414,7 +414,7 @@ CLEANFILES += flake8-check include $(srcdir)/manpages.mk $(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.py python/build/soutil.py - @PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp + @PYTHONPATH=$$PYTHONPATH$(psep)$(srcdir)/python $(PYTHON3) $(srcdir)/build-aux/sodepends.py -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp @if cmp -s $(@F).tmp $@; then \ touch $@; \ rm -f $(@F).tmp; \ diff --git a/Vagrantfile b/Vagrantfile index fbd772a1bec5..236e3a7bdcb7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,12 +8,14 @@ Vagrant.require_version ">=1.7.0" $bootstrap_fedora = <