Merge "pep8 db.py"

This commit is contained in:
Jenkins 2012-11-26 23:59:00 +00:00 committed by Gerrit Code Review
commit 2ad23a25e8

View File

@ -243,7 +243,8 @@ class DatabaseBroker(object):
if os.path.exists(self.db_file):
# It's as if there was a "condition" where different parts
# of the system were "racing" each other.
raise DatabaseConnectionError(self.db_file,
raise DatabaseConnectionError(
self.db_file,
'DB created by someone else while working?')
renamer(tmp_db_file, self.db_file)
self.conn = get_db_connection(self.db_file, self.timeout)
@ -285,7 +286,8 @@ class DatabaseBroker(object):
dbs_path = os.path.dirname(partition_path)
device_path = os.path.dirname(dbs_path)
quar_path = os.path.join(device_path, 'quarantined',
self.db_type + 's', os.path.basename(self.db_dir))
self.db_type + 's',
os.path.basename(self.db_dir))
try:
renamer(self.db_dir, quar_path)
except OSError, e:
@ -808,9 +810,11 @@ class ContainerBroker(DatabaseBroker):
try:
(name, timestamp, size, content_type, etag,
deleted) = pickle.loads(entry.decode('base64'))
item_list.append({'name': name, 'created_at':
timestamp, 'size': size, 'content_type':
content_type, 'etag': etag,
item_list.append({'name': name,
'created_at': timestamp,
'size': size,
'content_type': content_type,
'etag': etag,
'deleted': deleted})
except Exception:
self.logger.exception(
@ -1334,7 +1338,8 @@ class AccountBroker(DatabaseBroker):
(name, put_timestamp, delete_timestamp,
object_count, bytes_used, deleted) = \
pickle.loads(entry.decode('base64'))
item_list.append({'name': name,
item_list.append(
{'name': name,
'put_timestamp': put_timestamp,
'delete_timestamp': delete_timestamp,
'object_count': object_count,