InMemoryDB: provide None for dbname

This commit is contained in:
Doug Blank 2016-04-30 10:05:17 -04:00
parent cec4bd7a15
commit 9690c20cbc

View File

@ -2025,13 +2025,14 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
"""
In DbGeneric, the database is in a text file at the path
"""
filepath = os.path.join(self._directory, "name.txt")
try:
with open(filepath, "r") as name_file:
name = name_file.readline().strip()
except (OSError, IOError) as msg:
LOG.error(str(msg))
name = None
name = None
if self._directory:
filepath = os.path.join(self._directory, "name.txt")
try:
with open(filepath, "r") as name_file:
name = name_file.readline().strip()
except (OSError, IOError) as msg:
LOG.error(str(msg))
return name
def _order_by_person_key(self, person):