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