Flake8: Fix E128

Fix and enable E128:
E128 continuation line under-indented for visual indent

Partial-Bug: #1333290

Change-Id: I72f673d291c388fc4df19e9585fb02e23c21fec3
This commit is contained in:
Andreas Jaeger 2014-08-24 21:27:08 +02:00
parent 0f76ed578b
commit 4a49b5e562
9 changed files with 33 additions and 21 deletions

View File

@ -36,12 +36,14 @@ class ShareServersNegativeAdminTest(base.BaseSharesAdminTest):
@test.attr(type=["gate", "smoke", "negative", ]) @test.attr(type=["gate", "smoke", "negative", ])
def test_try_show_share_server_with_member(self): def test_try_show_share_server_with_member(self):
self.assertRaises(exceptions.Unauthorized, self.assertRaises(exceptions.Unauthorized,
self.member_shares_client.show_share_server, 'fake_id') self.member_shares_client.show_share_server,
'fake_id')
@test.attr(type=["gate", "smoke", "negative", ]) @test.attr(type=["gate", "smoke", "negative", ])
def test_try_show_share_server_details_with_member(self): def test_try_show_share_server_details_with_member(self):
self.assertRaises(exceptions.Unauthorized, self.assertRaises(exceptions.Unauthorized,
self.member_shares_client.show_share_server_details, 'fake_id') self.member_shares_client.show_share_server_details,
'fake_id')
@test.attr(type=["gate", "smoke", "negative", ]) @test.attr(type=["gate", "smoke", "negative", ])
def test_show_share_server_with_inexistent_id(self): def test_show_share_server_with_inexistent_id(self):

View File

@ -37,47 +37,54 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
@test.attr(type=["gate", "smoke", ]) @test.attr(type=["gate", "smoke", ])
def test_try_create_extra_specs_with_user(self): def test_try_create_extra_specs_with_user(self):
vt = self._create_volume_type() vt = self._create_volume_type()
self.assertRaises(exceptions.Unauthorized, self.assertRaises(
exceptions.Unauthorized,
self.member_shares_client.create_volume_type_extra_specs, self.member_shares_client.create_volume_type_extra_specs,
vt["id"], {"key": "new_value"}) vt["id"], {"key": "new_value"})
@test.attr(type=["gate", "smoke", ]) @test.attr(type=["gate", "smoke", ])
def test_try_list_extra_specs_with_user(self): def test_try_list_extra_specs_with_user(self):
vt = self._create_volume_type() vt = self._create_volume_type()
self.assertRaises(exceptions.Unauthorized, self.assertRaises(
exceptions.Unauthorized,
self.member_shares_client.list_volume_types_extra_specs, vt["id"]) self.member_shares_client.list_volume_types_extra_specs, vt["id"])
@test.attr(type=["gate", "smoke", ]) @test.attr(type=["gate", "smoke", ])
def test_try_get_extra_spec_with_user(self): def test_try_get_extra_spec_with_user(self):
vt = self._create_volume_type() vt = self._create_volume_type()
self.assertRaises(exceptions.Unauthorized, self.assertRaises(
exceptions.Unauthorized,
self.member_shares_client.get_volume_type_extra_spec, self.member_shares_client.get_volume_type_extra_spec,
vt["id"], "key") vt["id"], "key")
@test.attr(type=["gate", "smoke", ]) @test.attr(type=["gate", "smoke", ])
def test_try_get_extra_specs_with_user(self): def test_try_get_extra_specs_with_user(self):
vt = self._create_volume_type() vt = self._create_volume_type()
self.assertRaises(exceptions.Unauthorized, self.assertRaises(
exceptions.Unauthorized,
self.member_shares_client.get_volume_type_extra_specs, vt["id"]) self.member_shares_client.get_volume_type_extra_specs, vt["id"])
@test.attr(type=["gate", "smoke", ]) @test.attr(type=["gate", "smoke", ])
def test_try_update_extra_spec_with_user(self): def test_try_update_extra_spec_with_user(self):
vt = self._create_volume_type() vt = self._create_volume_type()
self.assertRaises(exceptions.Unauthorized, self.assertRaises(
exceptions.Unauthorized,
self.member_shares_client.update_volume_type_extra_spec, self.member_shares_client.update_volume_type_extra_spec,
vt["id"], "key", "new_value") vt["id"], "key", "new_value")
@test.attr(type=["gate", "smoke", ]) @test.attr(type=["gate", "smoke", ])
def test_try_update_extra_specs_with_user(self): def test_try_update_extra_specs_with_user(self):
vt = self._create_volume_type() vt = self._create_volume_type()
self.assertRaises(exceptions.Unauthorized, self.assertRaises(
exceptions.Unauthorized,
self.member_shares_client.update_volume_type_extra_specs, self.member_shares_client.update_volume_type_extra_specs,
vt["id"], {"key": "new_value"}) vt["id"], {"key": "new_value"})
@test.attr(type=["gate", "smoke", ]) @test.attr(type=["gate", "smoke", ])
def test_try_delete_extra_specs_with_user(self): def test_try_delete_extra_specs_with_user(self):
vt = self._create_volume_type() vt = self._create_volume_type()
self.assertRaises(exceptions.Unauthorized, self.assertRaises(
exceptions.Unauthorized,
self.member_shares_client.delete_volume_type_extra_spec, self.member_shares_client.delete_volume_type_extra_spec,
vt["id"], "key") vt["id"], "key")

View File

@ -162,8 +162,10 @@ class NetAppClusteredShareDriver(driver.ShareDriver):
except naapi.NaApiError as e: except naapi.NaApiError as e:
LOG.error(_("Could not get licenses list. %s.") % e) LOG.error(_("Could not get licenses list. %s.") % e)
else: else:
self._licenses = [l.get_child_content('package').lower() self._licenses = [
for l in licenses.get_child_by_name('licenses').get_children()] l.get_child_content('package').lower()
for l in licenses.get_child_by_name('licenses').get_children()
]
log_data = { log_data = {
'backend': self.backend_name, 'backend': self.backend_name,
'licenses': ', '.join(self._licenses), 'licenses': ', '.join(self._licenses),

View File

@ -148,7 +148,8 @@ class FilterSchedulerTestCase(test_scheduler.SchedulerTestCase):
retry = dict(num_attempts=2) retry = dict(num_attempts=2)
filter_properties = dict(retry=retry) filter_properties = dict(retry=retry)
self.assertRaises(exception.NoValidHost, sched._schedule_share, self.assertRaises(exception.NoValidHost, sched._schedule_share,
self.context, request_spec, filter_properties=filter_properties) self.context, request_spec,
filter_properties=filter_properties)
def test_add_retry_host(self): def test_add_retry_host(self):
retry = dict(num_attempts=1, hosts=[]) retry = dict(num_attempts=1, hosts=[])

View File

@ -50,6 +50,6 @@ commands = bash tools/lintstack.sh
# #
# H904 wrap long lines in parentheses instead of a backslash # H904 wrap long lines in parentheses instead of a backslash
# reason: removed in hacking (https://review.openstack.org/#/c/101701/) # reason: removed in hacking (https://review.openstack.org/#/c/101701/)
ignore = E128,H404,H405,H501,H904 ignore = H404,H405,H501,H904
builtins = _ builtins = _
exclude = .venv,.tox,dist,doc,openstack,*egg exclude = .venv,.tox,dist,doc,openstack,*egg