Update YAQL queries with groupBy

YAQL introduced a backward incompatible change in one of its minor
versions:
3fb9178401 (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 <aschultz@redhat.com>
This commit is contained in:
Emilien Macchi 2018-02-16 17:27:24 -08:00
parent 985e037dc2
commit e897da3b69
1 changed files with 6 additions and 6 deletions

View File

@ -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 %}