Firewall group table cannot be displayed when a group is associated with port(s)

Bug #1747524 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Neutron FWaaS dashboard
Fix Released
Critical
Akihiro Motoki

Bug Description

Firewall group table cannot be displayed when a group is associated with port(s) with an error:

 TemplateSyntaxError: 'unicode' object has no attribute 'name_or_id'

ERROR django.request Internal Server Error: /project/firewalls_v2/
Traceback (most recent call last):
  File "/opt/stack/horizon/.tox/manage/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)

...

  File "/opt/stack/horizon/.tox/manage/local/lib/python2.7/site-packages/django/template/base.py", line 911, in _resolve_lookup
    current = current()
  File "/opt/stack/horizon/horizon/tables/base.py", line 1938, in get_rows
    exc_info[2])
  File "/opt/stack/horizon/horizon/tables/base.py", line 1927, in get_rows
    row = self._meta.row_class(self, datum)
  File "/opt/stack/horizon/horizon/tables/base.py", line 587, in __init__
    self.load_cells()
  File "/opt/stack/horizon/horizon/tables/base.py", line 616, in load_cells
    cell = table._meta.cell_class(datum, column, self)
  File "/opt/stack/horizon/horizon/tables/base.py", line 737, in __init__
    self.data = self.get_data(datum, column, row)
  File "/opt/stack/horizon/horizon/tables/base.py", line 781, in get_data
    data = column.get_data(datum)
  File "/opt/stack/horizon/horizon/tables/base.py", line 421, in get_data
    data = self.get_raw_data(datum)
  File "/opt/stack/horizon/horizon/tables/base.py", line 395, in get_raw_data
    data = self.transform(datum)
  File "/home/ubuntu/work/neutron-fwaas-dashboard/neutron_fwaas_dashboard/dashboards/project/firewalls_v2/tables.py", line 257, in get_ports_name
    return ', '.join([port.name_or_id for port in datum.ports])
TemplateSyntaxError: 'unicode' object has no attribute 'name_or_id'

Akihiro Motoki (amotoki)
tags: added: v2-dashboard
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-fwaas-dashboard (master)

Fix proposed to branch: master
Review: https://review.openstack.org/541030

Changed in neutron-fwaas-dashboard:
assignee: nobody → Akihiro Motoki (amotoki)
status: New → In Progress
Akihiro Motoki (amotoki)
tags: added: queens-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-fwaas-dashboard (master)

Reviewed: https://review.openstack.org/541030
Committed: https://git.openstack.org/cgit/openstack/neutron-fwaas-dashboard/commit/?id=47a83bdc68c1803a862381bcb0f2c264521bd871
Submitter: Zuul
Branch: master

commit 47a83bdc68c1803a862381bcb0f2c264521bd871
Author: Akihiro Motoki <email address hidden>
Date: Tue Feb 6 06:51:27 2018 +0900

    firewall group table: fix handling of ports of FWG

    The previous code assumes a list of api.neutron.Port objects
    as FWG.ports but actually FWG.ports is a list of UUID.
    It seems to come from copy-and-paste of FWaaS v1 code without testing.

    This commit changes a value to be displayed from name/ID of ports
    to the number of ports. A list of ports can be long and it is not
    a good idea to show all ports in the firewall group table.
    I believe the number of associated ports makes more sense.

    Change-Id: I0fc7a41e7aaac3fdb305fb7ccdae466f7cbdf56f
    Closes-Bug: #1747524

Changed in neutron-fwaas-dashboard:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-fwaas-dashboard (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/546530

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-fwaas-dashboard (stable/queens)

Reviewed: https://review.openstack.org/546530
Committed: https://git.openstack.org/cgit/openstack/neutron-fwaas-dashboard/commit/?id=90678160afba1f9f0fef29a18feafed7ce6cffa8
Submitter: Zuul
Branch: stable/queens

commit 90678160afba1f9f0fef29a18feafed7ce6cffa8
Author: Akihiro Motoki <email address hidden>
Date: Tue Feb 6 06:51:27 2018 +0900

    firewall group table: fix handling of ports of FWG

    The previous code assumes a list of api.neutron.Port objects
    as FWG.ports but actually FWG.ports is a list of UUID.
    It seems to come from copy-and-paste of FWaaS v1 code without testing.

    This commit changes a value to be displayed from name/ID of ports
    to the number of ports. A list of ports can be long and it is not
    a good idea to show all ports in the firewall group table.
    I believe the number of associated ports makes more sense.

    Change-Id: I0fc7a41e7aaac3fdb305fb7ccdae466f7cbdf56f
    Closes-Bug: #1747524
    (cherry picked from commit 47a83bdc68c1803a862381bcb0f2c264521bd871)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-fwaas-dashboard 1.3.0

This issue was fixed in the openstack/neutron-fwaas-dashboard 1.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-fwaas-dashboard 1.4.0

This issue was fixed in the openstack/neutron-fwaas-dashboard 1.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.