From 3909658fc263d408206a8c06467efe5063169d62 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 27 Feb 2012 11:15:53 +0000 Subject: [PATCH] few minor just in case updates --- lib/core/dump.py | 1 + lib/utils/hashdb.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/dump.py b/lib/core/dump.py index b4c8f341d..bfab601dd 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -79,6 +79,7 @@ class Dump: self._outputBP = StringIO.StringIO() def getOutputFile(self): + self.flush() return self._outputFile def string(self, header, data, sort=True): diff --git a/lib/utils/hashdb.py b/lib/utils/hashdb.py index ae0a716a7..71434a2e3 100644 --- a/lib/utils/hashdb.py +++ b/lib/utils/hashdb.py @@ -10,6 +10,7 @@ See the file 'doc/COPYING' for copying permission import hashlib import sqlite3 import threading +import time from lib.core.common import serializeObject from lib.core.common import unserializeObject @@ -101,8 +102,10 @@ class HashDB(object): except sqlite3.IntegrityError: self.cursor.execute("UPDATE storage SET value=? WHERE id=?", (value, hash_,)) except sqlite3.OperationalError, ex: - if not 'locked' in ex.message: + if not any(_ in ex.message for _ in ('locked', 'I/O')): raise + else: + time.sleep(1) else: break finally: