def wait(self):
try:
while self._process.stderr:
poll = select([self._process.stderr.fileno()], [], [])
if len(poll) >= 1:
for fd in poll[0]:
read = self._process.stderr.readline()
line = self.parse_mongodump_line(read)
if not line:
continue
elif self.is_password_prompt(read):
self.handle_password_prompt()
elif self.is_failed_line(read):
self.handle_failure(read)
break
else:
logging.info(line)
if self._process.poll() is not None:
break
except Exception, e:
logging.exception("Error reading mongodump output: %s" % e)
finally:
self._process.communicate()
MongodumpThread.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录