@@ -41,29 +41,6 @@ parameters:
41
41
type : number
42
42
label : Resource group index of this node
43
43
44
- conditions :
45
- ports_gt_1_yaql :
46
- yaql :
47
- data :
48
- group_node_ports : { get_param: group_node_ports }
49
- expression : $.data.group_node_ports[0].len() > 1
50
- ports_gt_1 :
51
- not :
52
- equals :
53
- - ports_gt_1_yaql
54
- - False
55
-
56
- ports_gt_2_yaql :
57
- yaql :
58
- data :
59
- group_node_ports : { get_param: group_node_ports }
60
- expression : $.data.group_node_ports[0].len() > 2
61
- ports_gt_2 :
62
- not :
63
- equals :
64
- - ports_gt_2_yaql
65
- - False
66
-
67
44
resources :
68
45
69
46
instance :
@@ -73,36 +50,10 @@ resources:
73
50
flavor : { get_param: flavor }
74
51
image : { get_param: image }
75
52
key_name : { get_param: key_name }
76
- # FIXME: I would like to do this but Heat does not parse it:
77
- networks : { get_param: [ group_node_ports, {get_param: node_idx} ] }
78
- # networks:
79
- # list_concat:
80
- # - []
81
- # - { get_param: [ group_node_ports, {get_param: node_idx} ] }
82
- # networks:
83
- # - { get_param: [ group_node_ports, {get_param: node_idx}, 0 ] }
84
- # networks:
85
- # yaql:
86
- # data:
87
- # group_node_ports: { get_param: group_node_ports }
88
- # node_idx: { get_param: node_idx }
89
- # expression: $.data.group_node_ports[$.data.node_idx]
90
- #
91
- # FIXME: this works but is obviously limited to one port:
92
- # networks:
93
- # - port: { get_param: [ group_node_ports, {get_param: node_idx}, 0, port ] }
94
- # networks:
95
- # list_concat:
96
- # - [port: { get_param: [ group_node_ports, {get_param: node_idx}, 0, port ] }]
97
- # - if:
98
- # - ports_gt_1_yaql
99
- # - [port: { get_param: [ group_node_ports, {get_param: node_idx}, 1, port ] }]
100
- # - []
101
- # - if:
102
- # - False
103
- # - [port: { get_param: [ group_node_ports, {get_param: node_idx}, 2, port ] }]
104
- # - []
105
-
53
+ networks :
54
+ yaql :
55
+ expression : " $.data != '' and $.data.select({'port' => $.port}) or []"
56
+ data : {get_param: [group_node_ports, {get_param: node_idx}]}
106
57
availability_zone : { get_param: availability_zone }
107
58
config_drive : { get_param: config_drive }
108
59
0 commit comments