Protect from crash when attempting to read status of DB
svn: r11623
This commit is contained in:
parent
bef2ea3b4c
commit
71be10c1bc
@ -139,7 +139,10 @@ class CLIDbManager:
|
|||||||
return "Unknown", "Unknown"
|
return "Unknown", "Unknown"
|
||||||
dbmap1 = dbshelve.DBShelf(env)
|
dbmap1 = dbshelve.DBShelf(env)
|
||||||
fname = os.path.join(file_name, META + ".db")
|
fname = os.path.join(file_name, META + ".db")
|
||||||
|
try:
|
||||||
dbmap1.open(fname, META, db.DB_HASH, db.DB_RDONLY)
|
dbmap1.open(fname, META, db.DB_HASH, db.DB_RDONLY)
|
||||||
|
except:
|
||||||
|
return "Unknown", "Unknown"
|
||||||
version = dbmap1.get('version', default=None)
|
version = dbmap1.get('version', default=None)
|
||||||
dbmap1.close()
|
dbmap1.close()
|
||||||
dbmap2 = dbshelve.DBShelf(env)
|
dbmap2 = dbshelve.DBShelf(env)
|
||||||
|
Loading…
Reference in New Issue
Block a user