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: Iba0262fbc2af0903f02c8c28c7ba2b1d935abe7f
This commit is contained in:
parent
19b492aba7
commit
20311a0a50
@ -1178,7 +1178,7 @@ outputs:
|
|||||||
- if:
|
- if:
|
||||||
- nova_glance_rbd_download_multistore_id_set
|
- nova_glance_rbd_download_multistore_id_set
|
||||||
- yaql:
|
- yaql:
|
||||||
expression: let(k => $.data.key) -> list(coalesce($.data.multistore, {}).get($k)).select($.get("CephClusterName"))
|
expression: let(k => $.data.key) -> list(coalesce($.data.multistore, {}).get($k)).flatten().select($.get("CephClusterName"))
|
||||||
data:
|
data:
|
||||||
key: {get_attr: [RoleParametersValue, value, nova_glance_rbd_download_multistore_id]}
|
key: {get_attr: [RoleParametersValue, value, nova_glance_rbd_download_multistore_id]}
|
||||||
multistore: {get_param: GlanceMultistoreConfig}
|
multistore: {get_param: GlanceMultistoreConfig}
|
||||||
|
@ -55,7 +55,7 @@ resources:
|
|||||||
# 'metadata_settings', get the values from that key and get the
|
# 'metadata_settings', get the values from that key and get the
|
||||||
# unique ones. Also, filter values for networks not associated with
|
# unique ones. Also, filter values for networks not associated with
|
||||||
# this role.
|
# this role.
|
||||||
expression: let(role_networks => $.data.role_networks) -> list(coalesce($.data.role_data, []).where($ != null).where($.containsKey('metadata_settings')).metadata_settings.flatten().distinct().where($ != null and $.containsKey('network')).where($role_networks.contains($.network)))
|
expression: let(role_networks => $.data.role_networks) -> list(coalesce($.data.role_data, []).where($ != null).where($.containsKey('metadata_settings')).metadata_settings.flatten().distinct().where($ != null and $.containsKey('network')).where($role_networks.contains($.network))).flatten()
|
||||||
data:
|
data:
|
||||||
role_data: {get_param: RoleData}
|
role_data: {get_param: RoleData}
|
||||||
role_networks:
|
role_networks:
|
||||||
|
Loading…
Reference in New Issue
Block a user