Merge "pep8 direct client"

This commit is contained in:
Jenkins 2012-11-26 23:58:16 +00:00 committed by Gerrit Code Review
commit 67201c3159

View File

@ -74,8 +74,9 @@ def direct_get_account(node, part, account, marker=None, limit=None,
if not is_success(resp.status): if not is_success(resp.status):
resp.read() resp.read()
raise ClientException( raise ClientException(
'Account server %s:%s direct GET %s gave status %s' % (node['ip'], 'Account server %s:%s direct GET %s gave status %s' %
node['port'], repr('/%s/%s%s' % (node['device'], part, path)), (node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)),
resp.status), resp.status),
http_host=node['ip'], http_port=node['port'], http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status, http_device=node['device'], http_status=resp.status,
@ -162,8 +163,9 @@ def direct_get_container(node, part, account, container, marker=None,
if not is_success(resp.status): if not is_success(resp.status):
resp.read() resp.read()
raise ClientException( raise ClientException(
'Container server %s:%s direct GET %s gave stats %s' % (node['ip'], 'Container server %s:%s direct GET %s gave stats %s' %
node['port'], repr('/%s/%s%s' % (node['device'], part, path)), (node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)),
resp.status), resp.status),
http_host=node['ip'], http_port=node['port'], http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status, http_device=node['device'], http_status=resp.status,
@ -191,8 +193,7 @@ def direct_delete_container(node, part, account, container, conn_timeout=5,
raise ClientException( raise ClientException(
'Container server %s:%s direct DELETE %s gave status %s' % 'Container server %s:%s direct DELETE %s gave status %s' %
(node['ip'], node['port'], (node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)), repr('/%s/%s%s' % (node['device'], part, path)), resp.status),
resp.status),
http_host=node['ip'], http_port=node['port'], http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status, http_device=node['device'], http_status=resp.status,
http_reason=resp.reason) http_reason=resp.reason)
@ -263,8 +264,7 @@ def direct_get_object(node, part, account, container, obj, conn_timeout=5,
raise ClientException( raise ClientException(
'Object server %s:%s direct GET %s gave status %s' % 'Object server %s:%s direct GET %s gave status %s' %
(node['ip'], node['port'], (node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)), repr('/%s/%s%s' % (node['device'], part, path)), resp.status),
resp.status),
http_host=node['ip'], http_port=node['port'], http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status, http_device=node['device'], http_status=resp.status,
http_reason=resp.reason) http_reason=resp.reason)
@ -453,7 +453,8 @@ def retry(func, *args, **kwargs):
# Shouldn't actually get down here, but just in case. # Shouldn't actually get down here, but just in case.
if args and 'ip' in args[0]: if args and 'ip' in args[0]:
raise ClientException('Raise too many retries', raise ClientException('Raise too many retries',
http_host=args[0]['ip'], http_port=args[0]['port'], http_host=args[
0]['ip'], http_port=args[0]['port'],
http_device=args[0]['device']) http_device=args[0]['device'])
else: else:
raise ClientException('Raise too many retries') raise ClientException('Raise too many retries')