Display details of a security groups generate an exception when 2 rules overlap. Versions: This is happening with current master branch but is likely to happen with 5.7 - to be confirmed. Steps to Reproduce: 1. Create a security group $ neutron security-group-create test2 2. Add a rule to the security group: $ neutron security-group-rule-create --direction egress --ethertype IPv4 --protocol tcp --remote-ip-prefix 192.168.10.1/32 --port-range-min 88 --port-range-max 88 1d8f66dc-e8bb-4c77-b1b9-db5cde0a7dda 3. Add a rule that overlap previous rule (here port is specified): $ neutron security-group-rule-create --direction egress --ethertype IPv4 --protocol tcp --remote-ip-prefix 192.168.10.1/32 1d8f66dc-e8bb-4c77-b1b9-db5cde0a7dda 4. Use the UI to show the security group: Network -> Security Groups -> Select the created security group in the list. Actual results: The GUI display the following error: "comparison of Array with Array failed [security_group/show]" Additional info: Extract from rails log file: -------------------------------------------------------------------------------- [----] D, [2017-05-09T03:16:09.207462 #30871:3f8a6a6c25f8] DEBUG -- : FirewallRule Exists (0.4ms) SELECT 1 AS one FROM "firewall_rul es" WHERE "firewall_rules"."resource_id" = $1 AND "firewall_rules"."resource_type" = $2 LIMIT $3 [["resource_id", 2], ["resource_type", "SecurityGroup"], ["LIMIT", 1]] [----] D, [2017-05-09T03:16:09.209735 #30871:3f8a6a6c25f8] DEBUG -- : FirewallRule Load (0.3ms) SELECT "firewall_rules".* FROM "firew all_rules" WHERE "firewall_rules"."resource_id" = $1 AND "firewall_rules"."resource_type" = $2 [["resource_id", 2], ["resource_type", " SecurityGroup"]] [----] D, [2017-05-09T03:16:09.228601 #30871:3f8a6a6c25f8] DEBUG -- : FirewallRule Inst Including Associations (18.6ms - 2rows) [----] I, [2017-05-09T03:16:09.233374 #30871:3f8a6a6c25f8] INFO -- : Rendered /home/gildub/manageiq-ui-classic/app/views/layouts/_tex tual_groups_raw.html.haml (3176.5ms) [----] I, [2017-05-09T03:16:09.233508 #30871:3f8a6a6c25f8] INFO -- : Rendered /home/gildub/manageiq-ui-classic/app/views/layouts/_tex tual_groups_generic.html.haml (3184.3ms) [----] I, [2017-05-09T03:16:09.233928 #30871:3f8a6a6c25f8] INFO -- : Rendered /home/gildub/manageiq-ui-classic/app/views/security_gro up/show.html.haml within layouts/application (3193.6ms) [----] F, [2017-05-09T03:16:09.234221 #30871:3f8a6a6c25f8] FATAL -- : Error caught: [ActionView::Template::Error] comparison of Array wi th Array failed /home/gildub/manageiq-ui-classic/app/helpers/security_group_helper/textual_summary.rb:32:in `sort' /home/gildub/manageiq-ui-classic/app/helpers/security_group_helper/textual_summary.rb:32:in `textual_group_firewall' /home/gildub/manageiq-ui-classic/app/helpers/textual_summary_helper.rb:43:in `textual_group_render_options' --------------------------------------------------------------------------------
https://github.com/ManageIQ/manageiq-ui-classic/pull/1318
New commit detected on ManageIQ/manageiq-ui-classic/master: https://github.com/ManageIQ/manageiq-ui-classic/commit/f2d066f57d138b8ecb9058776cf35bc8ce15e6f7 commit f2d066f57d138b8ecb9058776cf35bc8ce15e6f7 Author: Harpreet Kataria <hkataria> AuthorDate: Tue May 9 12:09:14 2017 -0400 Commit: Harpreet Kataria <hkataria> CommitDate: Tue May 9 12:09:14 2017 -0400 Added to_i to port & end_port attributes Added to_i to 'port' & 'end_port' attributes, to prevent comparison of Array with Array error when there is no value provided for port or end_port fields. https://bugzilla.redhat.com/show_bug.cgi?id=1449053 app/helpers/security_group_helper/textual_summary.rb | 4 ++-- .../security_group_helper/textual_summary_spec.rb | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 spec/helpers/security_group_helper/textual_summary_spec.rb
I tested and confirm that using the aforementioned patch, a security group including overlapped rules can now be displayed.
Verified ======== 5.9.0.14