From patchwork Mon May 16 21:56:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 622763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3r7vSr0lBtz9sxb for ; Tue, 17 May 2016 07:57:16 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 051F1103A7; Mon, 16 May 2016 14:57:15 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id F3C10102F4 for ; Mon, 16 May 2016 14:57:13 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 7FF871E02FF for ; Mon, 16 May 2016 15:57:13 -0600 (MDT) X-ASG-Debug-ID: 1463435832-09eadd7e524ada0001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar5.cudamail.com with ESMTP id yV6V24BplunDQW3C (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 16 May 2016 15:57:12 -0600 (MDT) X-Barracuda-Envelope-From: joe@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO relay5-d.mail.gandi.net) (217.70.183.197) by mx3-pf3.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 16 May 2016 21:57:11 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at ovn.org designates 217.70.183.197 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.197 X-Barracuda-RBL-IP: 217.70.183.197 Received: from mfilter25-d.gandi.net (mfilter25-d.gandi.net [217.70.178.153]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 259F541C093 for ; Mon, 16 May 2016 23:57:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter25-d.gandi.net Received: from relay5-d.mail.gandi.net ([IPv6:::ffff:217.70.183.197]) by mfilter25-d.gandi.net (mfilter25-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id QfVlZnqaF5ox for ; Mon, 16 May 2016 23:57:08 +0200 (CEST) X-Originating-IP: 208.91.1.34 Received: from archer.eng.vmware.com (unknown [208.91.1.34]) (Authenticated sender: joe@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 3E9B141C08A for ; Mon, 16 May 2016 23:57:07 +0200 (CEST) X-CudaMail-Envelope-Sender: joe@ovn.org From: Joe Stringer To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-515054927 X-CudaMail-DTE: 051616 X-CudaMail-Originating-IP: 217.70.183.197 Date: Mon, 16 May 2016 14:56:59 -0700 X-ASG-Orig-Subj: [##CM-V3-515054927##][PATCH 2/2] ovs-dev.py: Update for python3. Message-Id: <1463435819-20238-2-git-send-email-joe@ovn.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1463435819-20238-1-git-send-email-joe@ovn.org> References: <1463435819-20238-1-git-send-email-joe@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1463435832 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH 2/2] ovs-dev.py: Update for python3. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Adapt to python-2.6+, including support for 3. Signed-off-by: Joe Stringer Acked-by: Russell Bryant --- utilities/ovs-dev.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py index 0ba4280a8ddf..40cd43e14730 100755 --- a/utilities/ovs-dev.py +++ b/utilities/ovs-dev.py @@ -54,7 +54,7 @@ def _sh(*args, **kwargs): def uname(): - return _sh("uname", "-r", capture=True)[0].strip() + return _sh("uname", "-r", capture=True)[0].decode().strip() def sudo(): @@ -296,13 +296,13 @@ def modinst(): sudo() try: _sh("rmmod", "openvswitch") - except subprocess.CalledProcessError, e: + except subprocess.CalledProcessError as e: pass # Module isn't loaded try: _sh("rm -f /lib/modules/%s/extra/openvswitch.ko" % uname()) _sh("rm -f /lib/modules/%s/extra/vport-*.ko" % uname()) - except subprocess.CalledProcessError, e: + except subprocess.CalledProcessError as e: pass # Module isn't installed conf() @@ -409,7 +409,7 @@ def main(): parser.add_option_group(group) group = optparse.OptionGroup(parser, "Optimization Flags") - for i in ["s", "g"] + range(4) + ["fast"]: + for i in ["s", "g"] + list(range(4)) + ["fast"]: group.add_option("--O%s" % str(i), dest="optimize", action="store_const", const=i, help="compile with -O%s" % str(i))