Flatten yaql list expressions
In python yaql 2, the expressions are returning a nested list but we need a list of dictionaries in order to use map_merge. This change adds flatten so it returns [] instead of [[]] when nothing is available. Change-Id: Ic5144c58ceb9bd146e2c470725ec7f4b65328c4d Closes-Bug: #1947193
This commit is contained in:
parent
33f319af97
commit
6b50e16223
@ -99,7 +99,7 @@ resources:
|
||||
type: comma_delimited_list
|
||||
value:
|
||||
yaql:
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('monitoring_subscription')).where($ != null))
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('monitoring_subscription')).where($ != null)).flatten()
|
||||
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
||||
|
||||
ServiceNames:
|
||||
@ -118,7 +118,7 @@ resources:
|
||||
value:
|
||||
map_merge:
|
||||
yaql:
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('global_config_settings')).where($ != null))
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('global_config_settings')).where($ != null)).flatten()
|
||||
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
||||
|
||||
KeystoneResourcesConfigs:
|
||||
@ -128,7 +128,7 @@ resources:
|
||||
value:
|
||||
map_merge:
|
||||
yaql:
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('keystone_resources')).where($ != null))
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('keystone_resources')).where($ != null)).flatten()
|
||||
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
||||
|
||||
ServiceConfigSettings:
|
||||
@ -328,7 +328,7 @@ resources:
|
||||
value:
|
||||
map_merge:
|
||||
yaql:
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('ansible_group_vars')).where($ != null))
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('ansible_group_vars')).where($ != null)).flatten()
|
||||
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
||||
|
||||
FirewallRules:
|
||||
@ -338,7 +338,7 @@ resources:
|
||||
value:
|
||||
map_merge:
|
||||
yaql:
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('firewall_rules')).where($ != null))
|
||||
expression: list(coalesce($.data.role_data, []).where($ != null).select($.get('firewall_rules')).where($ != null)).flatten()
|
||||
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user