ovs.stream: Simplify logic in Stream.wait().
authorBen Pfaff <blp@nicira.com>
Tue, 23 Aug 2011 18:16:57 +0000 (11:16 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 24 Aug 2011 19:06:53 +0000 (12:06 -0700)
Suggested-by: Reid Price <reid@nicira.com>
python/ovs/stream.py

index 5954c3148a76768e02483b71d49b553e1dd70db3..82d4557e953035636311ca14c0d777c9ae5684f2 100644 (file)
@@ -206,10 +206,10 @@ class Stream(object):
 
         if self.state == Stream.__S_CONNECTING:
             wait = Stream.W_CONNECT
-        if wait in (Stream.W_CONNECT, Stream.W_SEND):
-            poller.fd_wait(self.socket, select.POLLOUT)
-        else:
+        if wait == Stream.W_RECV:
             poller.fd_wait(self.socket, select.POLLIN)
+        else:
+            poller.fd_wait(self.socket, select.POLLOUT)
 
     def connect_wait(self, poller):
         self.wait(poller, Stream.W_CONNECT)