From 7f6a4b43856246995b8fa26b833155559f95e2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Wed, 18 May 2022 09:22:33 +0200 Subject: [PATCH] Filter empty string in PingTestGatewayIPsMap yagl 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 --- overcloud.j2.yaml | 2 +- ...Map-yaql-filter-empty-string-b024ce1bce9754ef.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-PingTestGatewayIPsMap-yaql-filter-empty-string-b024ce1bce9754ef.yaml diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml index 3b1589e0bd..e239203fd4 100644 --- a/overcloud.j2.yaml +++ b/overcloud.j2.yaml @@ -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 %} diff --git a/releasenotes/notes/fix-PingTestGatewayIPsMap-yaql-filter-empty-string-b024ce1bce9754ef.yaml b/releasenotes/notes/fix-PingTestGatewayIPsMap-yaql-filter-empty-string-b024ce1bce9754ef.yaml new file mode 100644 index 0000000000..5794403afc --- /dev/null +++ b/releasenotes/notes/fix-PingTestGatewayIPsMap-yaql-filter-empty-string-b024ce1bce9754ef.yaml @@ -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 `_. +