Fix the compatible issues related to filter function in stx-gui
Change-Id: I028818042952bc45e8b0edd843759b394cd43ae6 Story: 2003432 Task: 24628
This commit is contained in:
parent
dfe0ebc08a
commit
50c385f460
@ -497,15 +497,14 @@ class AddInterface(forms.SelfHandlingForm):
|
||||
cleaned_data.pop('ipv6_pool', None)
|
||||
|
||||
if ifclass == 'data':
|
||||
providernetworks = filter(
|
||||
None, cleaned_data.get('providernetworks_data', []))
|
||||
providernetworks = [_f for _f in cleaned_data.get(
|
||||
'providernetworks_data', []) if _f]
|
||||
elif ifclass == 'pci-passthrough':
|
||||
providernetworks = filter(None, cleaned_data.get(
|
||||
'providernetworks_pci', []))
|
||||
providernetworks = [_f for _f in cleaned_data.get(
|
||||
'providernetworks_pci', []) if _f]
|
||||
elif ifclass == 'pci-sriov':
|
||||
providernetworks = filter(
|
||||
None,
|
||||
cleaned_data.get('providernetworks_sriov', []))
|
||||
providernetworks = [_f for _f in cleaned_data.get(
|
||||
'providernetworks_sriov', []) if _f]
|
||||
else:
|
||||
providernetworks = []
|
||||
|
||||
|
@ -362,7 +362,7 @@ class SensorsFilterAction(tables.FilterAction):
|
||||
return True
|
||||
return False
|
||||
|
||||
return filter(comp, sensors)
|
||||
return list(filter(comp, sensors))
|
||||
|
||||
|
||||
class SensorsTable(tables.DataTable):
|
||||
|
@ -590,7 +590,7 @@ class HostsStorageFilterAction(tables.FilterAction):
|
||||
return True
|
||||
return False
|
||||
|
||||
return filter(comp, hosts)
|
||||
return list(filter(comp, hosts))
|
||||
|
||||
|
||||
class HostsComputeFilterAction(tables.FilterAction):
|
||||
@ -675,10 +675,10 @@ def get_task_or_status(host):
|
||||
patch_state = ""
|
||||
|
||||
return _("%s") % "<br />".join(
|
||||
filter(None, [task_or_status,
|
||||
patch_current,
|
||||
reboot_required,
|
||||
patch_state]))
|
||||
[_f for _f in [task_or_status,
|
||||
patch_current,
|
||||
reboot_required,
|
||||
patch_state] if _f])
|
||||
|
||||
|
||||
TASK_STATE_CHOICES = (
|
||||
|
@ -152,7 +152,7 @@ class PatchFilterAction(tables.FilterAction):
|
||||
return True
|
||||
return False
|
||||
|
||||
return filter(comp, patches)
|
||||
return list(filter(comp, patches))
|
||||
|
||||
|
||||
class PatchesTable(tables.DataTable):
|
||||
|
@ -56,9 +56,9 @@ class DetailPatchView(views.HorizonTemplateView):
|
||||
try:
|
||||
patch = stx_api.patch.get_patch(self.request, patch_id)
|
||||
patch.contents_display = "%s" % "\n".join(
|
||||
filter(None, patch.contents))
|
||||
[_f for _f in patch.contents if _f])
|
||||
patch.requires_display = "%s" % "\n".join(
|
||||
filter(None, patch.requires))
|
||||
[_f for _f in patch.requires if _f])
|
||||
except Exception:
|
||||
redirect = reverse(self.failure_url)
|
||||
exceptions.handle(self.request,
|
||||
|
Loading…
Reference in New Issue
Block a user