Reviewed: https://review.opendev.org/676950 Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=cdb191ec83f86dffade56be07ca53077d7c78b14 Submitter: Zuul Branch: master
commit cdb191ec83f86dffade56be07ca53077d7c78b14 Author: Akihiro Motoki <[email protected]> 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 <[email protected]> Change-Id: I6e05a7dc6b6655514ee2bff6bd327da86f13900a ** Changed in: horizon Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Dashboard (Horizon). 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 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 -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

