Fix available roles listing

This change updates the expression which filters roles by role_tags.
In case when there are no role_tags defined in plan-environment.ymal
The expression should return all available roles

Closes-Bug: 1784605
Change-Id: I81051b0321c42c1b02974c5de310de88fb1a9d8b
(cherry picked from commit d83b4bf14f)
This commit is contained in:
Jiri Tomasek 2018-07-31 10:35:46 +00:00
parent 00906ff6f2
commit 80bec968f6
1 changed files with 1 additions and 1 deletions

View File

@ -1405,7 +1405,7 @@ workflows:
transform_output:
publish:
status: SUCCESS
available_roles: <% let(root => $, roles => yaml_parse($.available_yaml_roles.join("\n"))) -> $roles.where($root.role_tags.toSet().intersect($.get(tags, []).toSet()) or $root.role_tags = null) %>
available_roles: <% let(root => $, roles => yaml_parse($.available_yaml_roles.join("\n"))) -> ($root.role_tags = null and $roles or $roles.where($root.role_tags.toSet().intersect($.get(tags, []).toSet()))) %>
publish-on-error:
status: FAILED
message: <% task().result %>