Skip to content

Commit c521eea

Browse files
committed
Changed vnet create function
1 parent c79470d commit c521eea

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

healthcheck/testtools/deploy.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,19 @@ def create_vnet(credentials,
8282
print("Resource group created...\n")
8383

8484
# Create virtual network
85-
async_vnet_creation = network_client.virtual_networks.create_or_update(
86-
resource_name_vnet,
87-
vnet_name,
88-
{
85+
async_vnet_creation = network_client.virtual_networks.begin_create_or_update(
86+
resource_group_name=resource_name_vnet,
87+
virtual_network_name=vnet_name,
88+
parameters={
89+
'location': location,
8990
'address_space': {
9091
'address_prefixes': [vnet_cidr]
91-
},
92-
'location': location
93-
92+
}
9493
}
9594
)
9695

97-
# Wait for the virtual network creation
98-
async_vnet_creation.wait()
96+
# Wait for the virtual network creation to complete
97+
async_vnet_creation.result()
9998

10099
print("Added a virtual network... \n")
101100

0 commit comments

Comments
 (0)