From patchwork Wed Aug 3 15:56:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 655497 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 3s4Hk22TRpz9t1F for ; Thu, 4 Aug 2016 01:56:26 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 5E80310BF2; Wed, 3 Aug 2016 08:56:25 -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 7C91C10929 for ; Wed, 3 Aug 2016 08:56:23 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 0C6731E03F8 for ; Wed, 3 Aug 2016 09:56:23 -0600 (MDT) X-ASG-Debug-ID: 1470239782-09eadd6db703b90001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id qJcuEtdiE0sMdYaM (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 03 Aug 2016 09:56:22 -0600 (MDT) X-Barracuda-Envelope-From: guru@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO relay6-d.mail.gandi.net) (217.70.183.198) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 3 Aug 2016 15:56:22 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at ovn.org designates 217.70.183.198 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.198 X-Barracuda-RBL-IP: 217.70.183.198 Received: from mfilter34-d.gandi.net (mfilter34-d.gandi.net [217.70.178.165]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id B90C1FB8AC for ; Wed, 3 Aug 2016 17:56:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter34-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter34-d.gandi.net (mfilter34-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 3RFM4co1UTih for ; Wed, 3 Aug 2016 17:56:18 +0200 (CEST) X-Originating-IP: 209.85.215.53 Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (Authenticated sender: guru@ovn.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 22C07FB8A7 for ; Wed, 3 Aug 2016 17:56:18 +0200 (CEST) Received: by mail-lf0-f53.google.com with SMTP id g62so164303458lfe.3 for ; Wed, 03 Aug 2016 08:56:18 -0700 (PDT) X-Gm-Message-State: AEkoousL52LBku/CHL+muqja1N/WNmaKgkIfDm2uTdsf7SRSezkaBpMSVWMZWYxkitgxXXDgKJMVuieUefS4Fw== X-Received: by 10.46.32.131 with SMTP id g3mr19280980lji.46.1470239777674; Wed, 03 Aug 2016 08:56:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.5.232 with HTTP; Wed, 3 Aug 2016 08:56:17 -0700 (PDT) In-Reply-To: <1470159883-4648-10-git-send-email-pboca@cloudbasesolutions.com> References: <1470159883-4648-1-git-send-email-pboca@cloudbasesolutions.com> <1470159883-4648-10-git-send-email-pboca@cloudbasesolutions.com> X-CudaMail-Envelope-Sender: guru@ovn.org From: Guru Shetty Date: Wed, 3 Aug 2016 08:56:17 -0700 X-Gmail-Original-Message-ID: Message-ID: X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-802034853 X-CudaMail-DTE: 080316 X-CudaMail-Originating-IP: 217.70.183.198 To: Paul Boca X-ASG-Orig-Subj: [##CM-E1-802034853##]Re: [ovs-dev] [PATCH V11 09/17] python tests: Fixed OSError not iterable on Windows X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1470239782 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 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 X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: "dev@openvswitch.org" Subject: Re: [ovs-dev] [PATCH V11 09/17] python tests: Fixed OSError not iterable on Windows 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: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" On 2 August 2016 at 10:45, Paul Boca wrote: > On Windows if this exception is triggered then it will raise an exception > while in the > exception handler. > > Signed-off-by: Paul-Daniel Boca > Acked-by: Alin Gabriel Serdean > I added the following incremental and applied this. # XXX rate-limit > --- > V2: No changes > V3: No changes > V4: No changes > V5: No changes > V6: No changes > V7: No changes > V8: Added comment when using OSError on Windows > V9: No changes > V10: No changes > V11: No changes > --- > python/ovs/poller.py | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/python/ovs/poller.py b/python/ovs/poller.py > index 20be801..3ebaf5a 100644 > --- a/python/ovs/poller.py > +++ b/python/ovs/poller.py > @@ -17,6 +17,7 @@ import ovs.timeval > import ovs.vlog > import select > import socket > +import os > > try: > import eventlet.patcher > @@ -168,6 +169,12 @@ class Poller(object): > try: > events = self.poll.poll(self.timeout) > self.__log_wakeup(events) > + except OSError as e: > + """ On Windows, the select function from poll raises > OSError > + exception if the polled array is empty.""" > + error = e.errno > + if error != errno.EINTR: > + vlog.err("poll: %s" % os.strerror(e.errno)) > except select.error as e: > # XXX rate-limit > error, msg = e > -- > 2.7.2.windows.1 > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev > diff --git a/python/ovs/poller.py b/python/ovs/poller.py index 3ebaf5a..de6bf22 100644 --- a/python/ovs/poller.py +++ b/python/ovs/poller.py @@ -172,8 +172,7 @@ class Poller(object): except OSError as e: """ On Windows, the select function from poll raises OSError exception if the polled array is empty.""" - error = e.errno - if error != errno.EINTR: + if e.errno != errno.EINTR: vlog.err("poll: %s" % os.strerror(e.errno)) except select.error as e: