Skip to content

Commit

Permalink
Pin pep8 to 1.3.3
Browse files Browse the repository at this point in the history
Standardize pep8 to 1.3.3 and cleared up any errors
found by pep8 tests.

Change-Id: Ib7eb97d0789556d1676ccad58b5d3364065b7d15
Signed-off-by: Chuck Short <chuck.short@canonical.com>
  • Loading branch information
Chuck Short authored and bcwaldon committed Nov 25, 2012
1 parent e195543 commit c0ec97f
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 124 deletions.
2 changes: 1 addition & 1 deletion glanceclient/common/base.py
Expand Up @@ -100,7 +100,7 @@ def __getattr__(self, k):

def __repr__(self):
reprkeys = sorted(k for k in self.__dict__.keys() if k[0] != '_' and
k != 'manager')
k != 'manager')
info = ", ".join("%s=%s" % (k, getattr(self, k)) for k in reprkeys)
return "<%s %s>" % (self.__class__.__name__, info)

Expand Down
4 changes: 2 additions & 2 deletions glanceclient/common/http.py
Expand Up @@ -54,7 +54,7 @@ def __init__(self, endpoint, **kwargs):

self.connection_class = self.get_connection_class(self.endpoint_scheme)
self.connection_kwargs = self.get_connection_kwargs(
self.endpoint_scheme, **kwargs)
self.endpoint_scheme, **kwargs)

self.auth_token = kwargs.get('token')

Expand Down Expand Up @@ -212,7 +212,7 @@ def raw_request(self, method, url, **kwargs):
'application/octet-stream')
if 'body' in kwargs:
if (hasattr(kwargs['body'], 'read')
and method.lower() in ('post', 'put')):
and method.lower() in ('post', 'put')):
# We use 'Transfer-Encoding: chunked' because
# body size may not always be known in advance.
kwargs['headers']['Transfer-Encoding'] = 'chunked'
Expand Down
227 changes: 119 additions & 108 deletions glanceclient/shell.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions glanceclient/v1/images.py
Expand Up @@ -212,7 +212,7 @@ def create(self, **kwargs):
hdrs['x-glance-api-copy-from'] = copy_from

resp, body_iter = self.api.raw_request(
'POST', '/v1/images', headers=hdrs, body=image_data)
'POST', '/v1/images', headers=hdrs, body=image_data)
body = json.loads(''.join([c for c in body_iter]))
return Image(self, self._format_image_meta_for_user(body['image']))

Expand Down Expand Up @@ -250,6 +250,6 @@ def update(self, image, **kwargs):

url = '/v1/images/%s' % base.getid(image)
resp, body_iter = self.api.raw_request(
'PUT', url, headers=hdrs, body=image_data)
'PUT', url, headers=hdrs, body=image_data)
body = json.loads(''.join([c for c in body_iter]))
return Image(self, self._format_image_meta_for_user(body['image']))
4 changes: 2 additions & 2 deletions glanceclient/v1/shell.py
Expand Up @@ -51,15 +51,15 @@
help='Filter images to those with a size less than this.')
@utils.arg('--property-filter', metavar='<KEY=VALUE>',
help="Filter images by a user-defined image property.",
action='append', dest='properties', default=[])
action='append', dest='properties', default=[])
@utils.arg('--page-size', metavar='<SIZE>', default=None, type=int,
help='Number of images to request in each paginated request.')
@utils.arg('--human-readable', action='store_true', default=False,
help='Print image size in a human-friendly format.')
def do_image_list(gc, args):
"""List images you can access."""
filter_keys = ['name', 'status', 'container_format', 'disk_format',
'size_min', 'size_max']
'size_min', 'size_max']
filter_items = [(key, getattr(args, key)) for key in filter_keys]
filters = dict([item for item in filter_items if item[1] is not None])

Expand Down
10 changes: 5 additions & 5 deletions tests/test_http.py
Expand Up @@ -37,10 +37,10 @@ def test_connection_refused(self):
m = mox.Mox()
m.StubOutWithMock(httplib.HTTPConnection, 'request')
httplib.HTTPConnection.request(
mox.IgnoreArg(),
mox.IgnoreArg(),
headers=mox.IgnoreArg(),
).AndRaise(socket.error())
mox.IgnoreArg(),
mox.IgnoreArg(),
headers=mox.IgnoreArg(),
).AndRaise(socket.error())
m.ReplayAll()
try:
client.json_request('GET', '/v1/images/detail?limit=20')
Expand All @@ -51,7 +51,7 @@ def test_connection_refused(self):
self.fail('An exception should have bypassed this line.')
except exc.CommunicationError, comm_err:
fail_msg = ("Exception message '%s' should contain '%s'" %
(comm_err.message, endpoint))
(comm_err.message, endpoint))
self.assertTrue(endpoint in comm_err.message, fail_msg)
finally:
m.UnsetStubs()
Expand Down
4 changes: 2 additions & 2 deletions tests/v1/test_images.py
Expand Up @@ -174,7 +174,7 @@
'DELETE': ({}, None),
},
'/v1/images/2': {
'HEAD': (
'HEAD': (
{
'x-image-meta-id': '2'
},
Expand All @@ -188,7 +188,7 @@
),
},
'/v1/images/3': {
'HEAD': (
'HEAD': (
{
'x-image-meta-id': '3'
},
Expand Down
2 changes: 1 addition & 1 deletion tests/v2/test_images.py
Expand Up @@ -43,7 +43,7 @@
{},
{
'images': [
{
{
'id': '3a4560a1-e585-443e-9b39-553b46ec92d1',
'name': 'image-1',
},
Expand Down
2 changes: 1 addition & 1 deletion tools/test-requires
Expand Up @@ -6,6 +6,6 @@ nose-exclude
nosexcover
openstack.nose_plugin
nosehtmloutput
pep8==1.2
pep8==1.3.3
setuptools-git>=0.4
sphinx>=1.1.2

0 comments on commit c0ec97f

Please sign in to comment.