From e897da3b690dd69883483d818e957fca85721622 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 16 Feb 2018 17:27:24 -0800 Subject: [PATCH] Update YAQL queries with groupBy YAQL introduced a backward incompatible change in one of its minor versions: https://github.com/openstack/yaql/commit/3fb91784018de335440b01b3b069fe45dc53e025#diff-f36776b660e5fe4f88e3295e5b751396R215 It changes the expected behavior of groupBy() aggregator, so we need to update our queries otherwise it fails with a "list index out of range" error. Change-Id: I2ca2ebb2c8d22aeedbcb6920072db5b6dba3311b Closes-Bug: #1750032 Co-Authored-By: Alex Schultz --- overcloud.j2.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml index 225b59a544..bb80715e16 100644 --- a/overcloud.j2.yaml +++ b/overcloud.j2.yaml @@ -532,7 +532,7 @@ resources: # list of maps, but appends to colliding lists so we can # create a map of lists for all nodes for each network yaql: - expression: dict($.data.where($ != null).flatten().selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()])) + expression: dict($.data.where($ != null).flatten().selectMany($.items()).groupBy($[0], $[1], $.flatten())) data: - {get_attr: [{{role.name}}, hostname_map]} @@ -688,7 +688,7 @@ resources: # list of maps, but appends to colliding lists when a service # is deployed on more than one role yaql: - expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()])) + expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], $.flatten())) data: l: {% for role in roles %} @@ -696,7 +696,7 @@ resources: {% endfor %} service_node_names: yaql: - expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()])) + expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], $.flatten())) data: l: {% for role in roles %} @@ -704,7 +704,7 @@ resources: {% endfor %} short_service_node_names: yaql: - expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()])) + expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], $.flatten())) data: l: {% for role in roles %} @@ -712,7 +712,7 @@ resources: {% endfor %} short_service_bootstrap_node: yaql: - expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten().first()])) + expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], $.flatten().first())) data: l: {% for role in roles %} @@ -904,7 +904,7 @@ resources: # list of maps, but appends to colliding lists when a service # is deployed on more than one role yaql: - expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()])) + expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], $.flatten())) data: l: {% for role in roles %}