2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-13 14:07:02 +00:00

python: Upgrade to vlog.

This patch upgrades the library code in the python/ovs directory to
the new vlog module.
This commit is contained in:
Ethan Jackson
2011-09-24 17:53:30 -07:00
parent b153e66790
commit 3a656eafb9
10 changed files with 106 additions and 99 deletions

View File

@@ -13,9 +13,11 @@
# limitations under the License.
import errno
import logging
import select
import ovs.timeval
import ovs.vlog
vlog = ovs.vlog.Vlog("poller")
class Poller(object):
@@ -96,13 +98,13 @@ class Poller(object):
# XXX rate-limit
error, msg = e
if error != errno.EINTR:
logging.error("poll: %s" % e[1])
vlog.err("poll: %s" % e[1])
finally:
self.__reset()
def __log_wakeup(self, events):
if not events:
logging.debug("%d-ms timeout" % self.timeout)
vlog.dbg("%d-ms timeout" % self.timeout)
else:
for fd, revents in events:
if revents != 0:
@@ -117,7 +119,7 @@ class Poller(object):
s += "[POLLHUP]"
if revents & select.POLLNVAL:
s += "[POLLNVAL]"
logging.debug("%s on fd %d" % (s, fd))
vlog.dbg("%s on fd %d" % (s, fd))
def __reset(self):
self.poll = select.poll()