mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixes regression introduced by edf1ac1ea6ffd5d44bb2bb62ad320364baf310a3
This commit is contained in:
parent
9133ae8c55
commit
cd14b8115b
1 changed files with 8 additions and 7 deletions
|
@ -486,14 +486,15 @@ def create_vpc(module, vpc_conn):
|
|||
'id': sn.id,
|
||||
})
|
||||
|
||||
# Sort subnets by the order they were listed in the play
|
||||
order = {}
|
||||
for idx, val in enumerate(subnets):
|
||||
order[val['cidr']] = idx
|
||||
if subnets is not None:
|
||||
# Sort subnets by the order they were listed in the play
|
||||
order = {}
|
||||
for idx, val in enumerate(subnets):
|
||||
order[val['cidr']] = idx
|
||||
|
||||
# Number of subnets in the play
|
||||
subnets_in_play = len(subnets)
|
||||
returned_subnets.sort(key=lambda x: order.get(x['cidr'], subnets_in_play))
|
||||
# Number of subnets in the play
|
||||
subnets_in_play = len(subnets)
|
||||
returned_subnets.sort(key=lambda x: order.get(x['cidr'], subnets_in_play))
|
||||
|
||||
return (vpc_dict, created_vpc_id, returned_subnets, changed)
|
||||
|
||||
|
|
Loading…
Reference in a new issue