Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Filter empty string in PingTestGatewayIPsMap yagl
Browse files Browse the repository at this point in the history
When using `ManageNetworks: false` the gateway IPs are
empty string instead of `null` when not set. The YAQL
expression filters `null` values, but the empty string
value is included in the list. The ping gateway test end
up trying to run "ping $args $empty_string" which fails.

This change improves the yaql expression to also filter
strings with 0 lenght.

Closes-Bug: #1973866
Change-Id: I7d8712223d077ab8e25239b891bd03a1324e01a8
  • Loading branch information
hjensas committed May 18, 2022
1 parent ccf8e0c commit 7f6a4b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion overcloud.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ resources:
{%- for role in roles %}
{{role.name}}:
yaql:
expression: list($.data.where($ != null)).flatten()
expression: list($.data.where($ != null and len($) > 0)).flatten()
data:
- {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_param: {{role.name}}ControlPlaneSubnet}, gateway_ip]}
{%- for network in networks %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
fixes:
- |
Fixes an issue where gateway ping validations performed during deployment
would fail. When setting the `ManageNetworks` parameter to `false` and no
gateway was configured, the list of gateway IP addresses to ping would
include empty strings for networks with no gateway. The validation would
attempt to run a ping command without the address to ping, which caused the
deployment to fail. See bug:
`1973866 <https://bugs.launchpad.net/tripleo/+bug/1973866>`_.

0 comments on commit 7f6a4b4

Please sign in to comment.