[Bug 1840465] Re: Fails to list security groups if one or more exists without rules

OpenStack Infra 1840465 at bugs.launchpad.net
Wed Oct 9 16:20:56 UTC 2019


Reviewed:  https://review.opendev.org/686485
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=9d73ebee7a1ce442f57fad319d6ca6b354ffe171
Submitter: Zuul
Branch:    stable/queens

commit 9d73ebee7a1ce442f57fad319d6ca6b354ffe171
Author: Akihiro Motoki <amotoki at gmail.com>
Date:   Mon Aug 19 16:35:42 2019 +0900

    Fix listing security groups when no rules
    
    When listing security groups in the dashboard and
    one or more security groups had no rules it failed
    because python throws a KeyError.
    
    This commit changes the neutron API wrapper in horizon
    to ensure ensure rule information in SG always exists.
    
    Closes-Bug: #1840465
    Co-Authored-By: Tobias Urdin <tobias.urdin at binero.se>
    Change-Id: I6e05a7dc6b6655514ee2bff6bd327da86f13900a
    (cherry picked from commit cdb191ec83f86dffade56be07ca53077d7c78b14)
    (cherry picked from commit 205c4465cdf8112779e8eb5f1618dcfc1b11e305)


** Tags added: in-stable-queens

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to horizon in Ubuntu.
https://bugs.launchpad.net/bugs/1840465

Title:
  Fails to list security groups if one or more exists without rules

Status in OpenStack Dashboard (Horizon):
  Fix Released
Status in horizon package in Ubuntu:
  New
Status in horizon source package in Bionic:
  New
Status in horizon source package in Disco:
  New
Status in horizon source package in Eoan:
  New

Bug description:
  Horizon 14.0.2 (rocky)
  If a security group without any rules exists the listing of security groups fails with a KeyError.

  Traceback (most recent call last):
    File "/usr/share/openstack-dashboard/openstack_dashboard/api/rest/utils.py", line 127, in _wrapped
      data = function(self, request, *args, **kw)
    File "/usr/share/openstack-dashboard/openstack_dashboard/api/rest/network.py", line 44, in get
      security_groups = api.neutron.security_group_list(request)
    File "/usr/lib/python2.7/site-packages/horizon/utils/memoized.py", line 95, in wrapped
      value = cache[key] = func(*args, **kwargs)
    File "/usr/share/openstack-dashboard/openstack_dashboard/api/neutron.py", line 1641, in security_group_list
      return SecurityGroupManager(request).list(**params)
    File "/usr/share/openstack-dashboard/openstack_dashboard/api/neutron.py", line 372, in list
      return self._list(**params)
    File "/usr/share/openstack-dashboard/openstack_dashboard/api/neutron.py", line 359, in _list
      return [SecurityGroup(sg) for sg in secgroups.get('security_groups')]
    File "/usr/share/openstack-dashboard/openstack_dashboard/api/neutron.py", line 240, in __init__
      for rule in sg['security_group_rules']]
  KeyError: 'security_group_rules'

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1840465/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list