Skip to content

Commit

Permalink
Fix E127 errors in openstack_dashboard/dashboards/project/
Browse files Browse the repository at this point in the history
E127 continuation line over-indented for visual indent

Partial-Bug: #1375931
Change-Id: Ia62781d24f13407ca600743b167392dddf6c271d
  • Loading branch information
amotoki committed Oct 11, 2014
1 parent c88d146 commit f99981f
Show file tree
Hide file tree
Showing 34 changed files with 497 additions and 502 deletions.
Expand Up @@ -82,9 +82,9 @@ def test_associate_post(self):
server = self.servers.first()

api.network.tenant_floating_ip_list(IsA(http.HttpRequest)) \
.AndReturn(self.floating_ips.list())
.AndReturn(self.floating_ips.list())
api.network.floating_ip_target_list(IsA(http.HttpRequest)) \
.AndReturn(self.servers.list())
.AndReturn(self.servers.list())
api.network.floating_ip_associate(IsA(http.HttpRequest),
floating_ip.id,
server.id)
Expand All @@ -104,9 +104,9 @@ def test_associate_post_with_redirect(self):
server = self.servers.first()

api.network.tenant_floating_ip_list(IsA(http.HttpRequest)) \
.AndReturn(self.floating_ips.list())
.AndReturn(self.floating_ips.list())
api.network.floating_ip_target_list(IsA(http.HttpRequest)) \
.AndReturn(self.servers.list())
.AndReturn(self.servers.list())
api.network.floating_ip_associate(IsA(http.HttpRequest),
floating_ip.id,
server.id)
Expand All @@ -127,13 +127,13 @@ def test_associate_post_with_exception(self):
server = self.servers.first()

api.network.tenant_floating_ip_list(IsA(http.HttpRequest)) \
.AndReturn(self.floating_ips.list())
.AndReturn(self.floating_ips.list())
api.network.floating_ip_target_list(IsA(http.HttpRequest)) \
.AndReturn(self.servers.list())
.AndReturn(self.servers.list())
api.network.floating_ip_associate(IsA(http.HttpRequest),
floating_ip.id,
server.id) \
.AndRaise(self.exceptions.nova)
.AndRaise(self.exceptions.nova)
self.mox.ReplayAll()

form_data = {'instance_id': server.id,
Expand All @@ -152,11 +152,11 @@ def test_disassociate_post(self):
server = self.servers.first()

api.nova.server_list(IsA(http.HttpRequest)) \
.AndReturn([self.servers.list(), False])
.AndReturn([self.servers.list(), False])
api.network.floating_ip_supported(IsA(http.HttpRequest)) \
.AndReturn(True)
api.network.tenant_floating_ip_list(IsA(http.HttpRequest)) \
.AndReturn(self.floating_ips.list())
.AndReturn(self.floating_ips.list())
api.network.floating_ip_disassociate(IsA(http.HttpRequest),
floating_ip.id,
server.id)
Expand All @@ -177,7 +177,7 @@ def test_disassociate_post_with_exception(self):
server = self.servers.first()

api.nova.server_list(IsA(http.HttpRequest)) \
.AndReturn([self.servers.list(), False])
.AndReturn([self.servers.list(), False])
api.network.floating_ip_supported(IsA(http.HttpRequest)) \
.AndReturn(True)
api.network.tenant_floating_ip_list(IsA(http.HttpRequest)) \
Expand Down
Expand Up @@ -61,8 +61,9 @@ def handle(self, request, data):
keypair = api.nova.keypair_import(request,
data['name'],
data['public_key'])
messages.success(request, _('Successfully imported public key: %s')
% data['name'])
messages.success(request,
_('Successfully imported public key: %s')
% data['name'])
return keypair
except Exception:
exceptions.handle(request, ignore=True)
Expand Down
Expand Up @@ -42,7 +42,7 @@ def test_delete_keypair(self):
api.network.floating_ip_supported(IsA(http.HttpRequest)) \
.AndReturn(True)
api.nova.keypair_list(IsA(http.HttpRequest)) \
.AndReturn(self.keypairs.list())
.AndReturn(self.keypairs.list())
api.nova.keypair_delete(IsA(http.HttpRequest), keypair.name)
self.mox.ReplayAll()

Expand All @@ -60,9 +60,9 @@ def test_delete_keypair_exception(self):
api.network.floating_ip_supported(IsA(http.HttpRequest)) \
.AndReturn(True)
api.nova.keypair_list(IsA(http.HttpRequest)) \
.AndReturn(self.keypairs.list())
.AndReturn(self.keypairs.list())
api.nova.keypair_delete(IsA(http.HttpRequest), keypair.name) \
.AndRaise(self.exceptions.nova)
.AndRaise(self.exceptions.nova)
self.mox.ReplayAll()

formData = {'action': 'keypairs__delete__%s' % keypair.name}
Expand Down Expand Up @@ -139,7 +139,7 @@ def test_import_keypair_invalid_key(self):
public_key = "ABCDEF"

api.nova.keypair_import(IsA(http.HttpRequest), key_name, public_key) \
.AndRaise(self.exceptions.nova)
.AndRaise(self.exceptions.nova)
self.mox.ReplayAll()

formData = {'method': 'ImportKeypair',
Expand Down Expand Up @@ -169,7 +169,7 @@ def test_generate_keypair_exception(self):
keypair = self.keypairs.first()

api.nova.keypair_create(IsA(http.HttpRequest), keypair.name) \
.AndRaise(self.exceptions.nova)
.AndRaise(self.exceptions.nova)
self.mox.ReplayAll()

context = {'keypair_name': keypair.name}
Expand Down
Expand Up @@ -27,9 +27,9 @@
url(r'^create/$', views.CreateView.as_view(), name='create'),
url(r'^import/$', views.ImportView.as_view(), name='import'),
url(r'^(?P<keypair_name>[^/]+)/download/$', views.DownloadView.as_view(),
name='download'),
name='download'),
url(r'^(?P<keypair_name>[^/]+)/generate/$', views.GenerateView.as_view(),
name='generate'),
name='generate'),
url(r'^(?P<keypair_name>[^/]+)/(?P<optional>[^/]+)/generate/$',
views.GenerateView.as_view(), name='generate'),
views.GenerateView.as_view(), name='generate'),
)
Expand Up @@ -75,8 +75,8 @@ def get(self, request, keypair_name=None, optional=None):
redirect=redirect)

response = http.HttpResponse(content_type='application/binary')
response['Content-Disposition'] = \
'attachment; filename=%s.pem' % slugify(keypair.name)
response['Content-Disposition'] = ('attachment; filename=%s.pem'
% slugify(keypair.name))
response.write(keypair.private_key)
response['Content-Length'] = str(len(response.content))
return response
Expand Up @@ -52,7 +52,7 @@ def handle(self, request, data):
data['description'])
messages.success(request,
_('Successfully created security group: %s')
% data['name'])
% data['name'])
return sg
except Exception:
redirect = reverse("horizon:project:access_and_security:index")
Expand Down Expand Up @@ -82,7 +82,7 @@ def handle(self, request, data):
data['description'])
messages.success(request,
_('Successfully updated security group: %s')
% data['name'])
% data['name'])
return sg
except Exception:
redirect = reverse("horizon:project:access_and_security:index")
Expand Down Expand Up @@ -206,16 +206,16 @@ class AddRule(forms.SelfHandlingForm):
'data-slug': 'remote'}))

cidr = forms.IPField(label=_("CIDR"),
required=False,
initial="0.0.0.0/0",
help_text=_("Classless Inter-Domain Routing "
"(e.g. 192.168.0.0/24)"),
version=forms.IPv4 | forms.IPv6,
mask=True,
widget=forms.TextInput(
attrs={'class': 'switched',
'data-switch-on': 'remote',
'data-remote-cidr': _('CIDR')}))
required=False,
initial="0.0.0.0/0",
help_text=_("Classless Inter-Domain Routing "
"(e.g. 192.168.0.0/24)"),
version=forms.IPv4 | forms.IPv6,
mask=True,
widget=forms.TextInput(
attrs={'class': 'switched',
'data-switch-on': 'remote',
'data-remote-cidr': _('CIDR')}))

security_group = forms.ChoiceField(label=_('Security Group'),
required=False,
Expand Down
Expand Up @@ -81,7 +81,7 @@ def _add_security_group_rule_fixture(self, **kwargs):
def test_update_security_groups_get(self):
sec_group = self.security_groups.first()
api.network.security_group_get(IsA(http.HttpRequest),
sec_group.id).AndReturn(sec_group)
sec_group.id).AndReturn(sec_group)
self.mox.ReplayAll()

res = self.client.get(reverse('horizon:project:access_and_security:'
Expand All @@ -97,12 +97,12 @@ def test_update_security_groups_get(self):
def test_update_security_groups_post(self):
sec_group = self.security_groups.get(name="other_group")
api.network.security_group_update(IsA(http.HttpRequest),
str(sec_group.id),
sec_group.name,
sec_group.description) \
str(sec_group.id),
sec_group.name,
sec_group.description) \
.AndReturn(sec_group)
api.network.security_group_get(IsA(http.HttpRequest),
sec_group.id).AndReturn(sec_group)
sec_group.id).AndReturn(sec_group)
self.mox.ReplayAll()

formData = {'method': 'UpdateGroup',
Expand Down Expand Up @@ -182,8 +182,8 @@ def test_detail_get_exception(self):
sec_group = self.security_groups.first()

api.network.security_group_get(IsA(http.HttpRequest),
sec_group.id) \
.AndRaise(self.exceptions.nova)
sec_group.id) \
.AndRaise(self.exceptions.nova)

self.mox.ReplayAll()

Expand Down
Expand Up @@ -206,8 +206,8 @@ def _test_create_button_disabled_when_quota_exceeded(self,

create_link = tables.CreateGroup()
url = create_link.get_link_url()
classes = list(create_link.get_default_classes())\
+ list(create_link.classes)
classes = (list(create_link.get_default_classes())
+ list(create_link.classes))
link_name = "%s (%s)" % (unicode(create_link.verbose_name),
"Quota exceeded")
expected_string = "<a href='%s' title='%s' class='%s disabled' "\
Expand Down
8 changes: 4 additions & 4 deletions openstack_dashboard/dashboards/project/containers/urls.py
Expand Up @@ -34,7 +34,7 @@
name='create'),

url(r'^(?P<container_name>.+?)/(?P<subfolder_path>(.+/)+)'
'?container_detail$',
'?container_detail$',
views.ContainerDetailView.as_view(),
name='container_detail'),

Expand All @@ -52,13 +52,13 @@
name='object_upload'),

url(r'^(?P<container_name>.+?)/(?P<subfolder_path>(.+/)+)'
'?create_pseudo_folder',
'?create_pseudo_folder',
views.CreatePseudoFolderView.as_view(),
name='create_pseudo_folder'),

url(r'^(?P<container_name>[^/]+)/'
r'(?P<subfolder_path>(.+/)+)?'
r'(?P<object_name>.+)/copy$',
r'(?P<subfolder_path>(.+/)+)?'
r'(?P<object_name>.+)/copy$',
views.CopyView.as_view(),
name='object_copy'),

Expand Down
Expand Up @@ -118,8 +118,8 @@ def populate_image_choices(self, request, context):
hadoop_version)

return [(image.id, image.name) for image in all_images
if set(details.required_image_tags).
issubset(set(image.tags))]
if (set(details.required_image_tags).
issubset(set(image.tags)))]
except Exception:
exceptions.handle(request,
_("Unable to fetch image choices."))
Expand Down
Expand Up @@ -93,8 +93,8 @@ def get_data(self, request, context, *args, **kwargs):
backup.parent = api.trove.backup_get(request, backup.parent_id)
except Exception:
redirect = reverse('horizon:project:database_backups:index')
msg = _('Unable to retrieve details for parent backup: %s') % \
backup.parent_id
msg = (_('Unable to retrieve details for parent backup: %s')
% backup.parent_id)
exceptions.handle(self.request, msg, redirect=redirect)

try:
Expand Down
4 changes: 2 additions & 2 deletions openstack_dashboard/dashboards/project/databases/tests.py
Expand Up @@ -121,7 +121,7 @@ def test_index_flavor_list_exception(self):

@test.create_stubs({
api.trove: ('flavor_list', 'backup_list',
'datastore_list', 'datastore_version_list')})
'datastore_list', 'datastore_version_list')})
def test_launch_instance(self):
api.trove.flavor_list(IsA(http.HttpRequest))\
.AndReturn(self.flavors.list())
Expand All @@ -144,7 +144,7 @@ def test_launch_instance_exception_on_flavors(self):
self.mox.ReplayAll()

toSuppress = ["openstack_dashboard.dashboards.project.databases."
"workflows.create_instance",
"workflows.create_instance",
"horizon.workflows.base"]

# Suppress expected log messages in the test output
Expand Down
2 changes: 1 addition & 1 deletion openstack_dashboard/dashboards/project/firewalls/views.py
Expand Up @@ -201,7 +201,7 @@ def _get_object(self, *args, **kwargs):
firewall_id = self.kwargs['firewall_id']
try:
firewall = api.fwaas.firewall_get(self.request,
firewall_id)
firewall_id)
firewall.set_id_as_name_if_empty()
return firewall
except Exception:
Expand Down
19 changes: 10 additions & 9 deletions openstack_dashboard/dashboards/project/images/images/tests.py
Expand Up @@ -165,7 +165,7 @@ def test_image_create_post_copy_from(self):
'description': data['description'],
'architecture': data['architecture']},
name=data['name']). \
AndReturn(self.images.first())
AndReturn(self.images.first())
self.mox.ReplayAll()

url = reverse('horizon:project:images:images:create')
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_image_create_post_upload(self):
'architecture': data['architecture']},
name=data['name'],
data=IsA(InMemoryUploadedFile)). \
AndReturn(self.images.first())
AndReturn(self.images.first())
self.mox.ReplayAll()

url = reverse('horizon:project:images:images:create')
Expand All @@ -219,7 +219,7 @@ def test_image_detail_get(self):
image = self.images.first()

api.glance.image_get(IsA(http.HttpRequest), str(image.id)) \
.AndReturn(self.images.first())
.AndReturn(self.images.first())
self.mox.ReplayAll()

res = self.client.get(reverse('horizon:project:images:images:detail',
Expand All @@ -237,7 +237,7 @@ def test_image_detail_custom_props_get(self):
image = self.images.list()[8]

api.glance.image_get(IsA(http.HttpRequest), str(image.id)) \
.AndReturn(image)
.AndReturn(image)
self.mox.ReplayAll()

res = self.client.get(reverse('horizon:project:images:images:detail',
Expand All @@ -264,7 +264,7 @@ def test_protected_image_detail_get(self):
image = self.images.list()[2]

api.glance.image_get(IsA(http.HttpRequest), str(image.id)) \
.AndReturn(image)
.AndReturn(image)
self.mox.ReplayAll()

res = self.client.get(
Expand All @@ -279,7 +279,7 @@ def test_image_detail_get_with_exception(self):
image = self.images.first()

api.glance.image_get(IsA(http.HttpRequest), str(image.id)) \
.AndRaise(self.exceptions.glance)
.AndRaise(self.exceptions.glance)
self.mox.ReplayAll()

url = reverse('horizon:project:images:images:detail',
Expand Down Expand Up @@ -347,9 +347,10 @@ def _expected(self, filter_string):
if filter_string == 'public':
return filter(lambda im: im.is_public, images)
if filter_string == 'shared':
return filter(lambda im: not im.is_public and
im.owner != my_tenant_id and
im.owner not in special, images)
return filter(lambda im: (not im.is_public and
im.owner != my_tenant_id and
im.owner not in special),
images)
if filter_string == 'project':
filter_string = my_tenant_id
return filter(lambda im: im.owner == filter_string, images)
Expand Up @@ -45,7 +45,7 @@ def test_create_get_server_exception(self):
server = self.servers.first()
self.mox.StubOutWithMock(api.nova, 'server_get')
api.nova.server_get(IsA(http.HttpRequest), server.id) \
.AndRaise(self.exceptions.nova)
.AndRaise(self.exceptions.nova)
self.mox.ReplayAll()

url = reverse('horizon:project:images:snapshots:create',
Expand Down

0 comments on commit f99981f

Please sign in to comment.