Fix line continuations (flake8 E125, E126)

- E125: continuation line does not distinguish itself from next logical
  line
- E126: continuation line over-indented for hanging indent

Change-Id: I626a6d5d57db927e8b239f90569b5601c772f28b
This commit is contained in:
Dolph Mathews
2013-05-28 08:48:44 -05:00
parent 6372fdbf4b
commit abcf9db625
7 changed files with 25 additions and 31 deletions

View File

@@ -185,8 +185,8 @@ class HTTPClient(object):
if not token:
token = self.auth_token_from_user
if (not token and self.auth_ref
and not self.auth_ref.will_expire_soon(self.stale_duration)):
if (not token and self.auth_ref and not
self.auth_ref.will_expire_soon(self.stale_duration)):
token = self.auth_ref.auth_token
(keyring_key, auth_ref) = self.get_auth_ref_from_keyring(auth_url,

View File

@@ -71,8 +71,8 @@ class ServiceCatalog(object):
endpoints = service['endpoints']
for endpoint in endpoints:
if self.region_name and \
endpoint.get('region') != self.region_name:
if (self.region_name and
endpoint.get('region') != self.region_name):
continue
if not filter_value or endpoint.get(attr) == filter_value:
return endpoint[endpoint_type]

View File

@@ -99,8 +99,7 @@ class ShellTest(utils.TestCase):
def test_auth_no_credentials(self):
with testtools.ExpectedException(
exceptions.CommandError,
'Expecting authentication method'):
exceptions.CommandError, 'Expecting authentication method'):
self.shell('user-list')
def test_auth_password_authurl_no_username(self):
@@ -112,21 +111,18 @@ class ShellTest(utils.TestCase):
def test_auth_username_password_no_authurl(self):
with testtools.ExpectedException(
exceptions.CommandError,
'Expecting an auth URL via either'):
exceptions.CommandError, 'Expecting an auth URL via either'):
self.shell('--os-password=%s --os-username=%s user-list'
% (uuid.uuid4().hex, uuid.uuid4().hex))
def test_token_no_endpoint(self):
with testtools.ExpectedException(
exceptions.CommandError,
'Expecting an endpoint provided'):
exceptions.CommandError, 'Expecting an endpoint provided'):
self.shell('--token=%s user-list' % uuid.uuid4().hex)
def test_endpoint_no_token(self):
with testtools.ExpectedException(
exceptions.CommandError,
'Expecting a token provided'):
exceptions.CommandError, 'Expecting a token provided'):
self.shell('--endpoint=http://10.0.0.1:5000/v2.0/ user-list')
def test_shell_args(self):

View File

@@ -27,8 +27,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
downloadcache = ~/cache/pip
[flake8]
# E125: continuation line does not distinguish itself from next logical line
# E126: continuation line over-indented for hanging indent
# F401: imported but unused
# F811: redefinition of unused 'client' from line 81
# F821: undefined name
@@ -44,6 +42,6 @@ downloadcache = ~/cache/pip
# H403: multi line docstring end on new line
# H404: multi line docstring should start with a summary
# H802: git commit title
ignore = E125,E126,F401,F811,F821,F841,F999,H201,H202,H302,H304,H306,H401,H402,H403,H404,H802
ignore = F401,F811,F821,F841,F999,H201,H202,H302,H304,H306,H401,H402,H403,H404,H802
show-source = True
exclude = .venv,.tox,dist,doc,*egg