summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@kotori.zaitcev.us>2017-10-18 18:15:11 -0500
committerTim Burke <tim.burke@gmail.com>2018-07-24 11:51:14 -0700
commitb7adec7c688ca34f4fa4f11dae7c4078595cb7a5 (patch)
treedee39dc8d2d7a58442e67fa9f1832694eaab3816
parent0ff2d5e3b85a42914a89eac64ed9a87172334a2c (diff)
downloadswift-b7adec7c688ca34f4fa4f11dae7c4078595cb7a5.tar.gz
Be more tolerant of exception messages from sqlite
Parsing the text of error messages was always perilous, perhaps. Either way, this should fix the problem of test_get() failing. Change-Id: I929c2f6e60624241075a292d020c5707ea0ff1c3 (cherry picked from commit 0bca0d4d2bf95a37e4a403457ee5c7db4c0b6290)
-rw-r--r--swift/common/db.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/swift/common/db.py b/swift/common/db.py
index 91cb91976..ce4def9d0 100644
--- a/swift/common/db.py
+++ b/swift/common/db.py
@@ -333,7 +333,9 @@ class DatabaseBroker(object):
exc_hint = 'malformed'
elif 'malformed database schema' in str(exc_value):
exc_hint = 'malformed'
- elif 'file is encrypted or is not a database' in str(exc_value):
+ elif ' is not a database' in str(exc_value):
+ # older versions said 'file is not a database'
+ # now 'file is encrypted or is not a database'
exc_hint = 'corrupted'
elif 'disk I/O error' in str(exc_value):
exc_hint = 'disk error while accessing'