colossal-room-15708
03/31/2020, 11:00 PMfor
loop here?
vnet = network.VirtualNetwork('ssvc-vnet',
resource_group_name=resource_group.name,
name="ssvc-vnet-{0}".format(stack_name),
address_spaces=[ssvc_vnet_space],
subnets= [
for subnet in subnet_config:
{
name=subnet[0],
address_prefix=subnet[1],
virtual_network_name=vnet.name
)
},
]
)
It's syntactically incorrect, so I'm wondering what the best way to get this done anyways might be.custom_subnets = []
for subnet in subnet_config:
custom_subnets.append({"name":subnet[0],"address_prefix":subnet[1]})
# networking resources
vnet = network.VirtualNetwork('ssvc-vnet',
resource_group_name=resource_group.name,
name="ssvc-vnet-{0}".format(stack_name),
address_spaces=[ssvc_vnet_space],
subnets=custom_subnets
)
nutritious-shampoo-16116
04/01/2020, 7:42 AMsubnets = [
{
name=subnet[0],
address_prefix=subnet[1],
virtual_network_name=vnet.name
} for subnet in subnet_config
]
colossal-room-15708
04/01/2020, 9:26 AMnutritious-shampoo-16116
04/01/2020, 10:00 AMsubnets = [
{
"name":subnet[0],
"address_prefix": subnet[1],
"virtual_network_name": vnet.name
} for subnet in subnet_config
]
fixed the dict, = wont' work