Skip to content

Commit

Permalink
Locking on the NSG name
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Jun 14, 2017
1 parent c44d34e commit bcb5c86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions azurerm/resource_arm_network_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ func resourceArmNetworkSecurityGroupCreate(d *schema.ResourceData, meta interfac
return fmt.Errorf("Error Building list of Network Security Group Rules: %s", sgErr)
}

azureRMLockByName(name, networkSecurityGroupResourceName)
defer azureRMUnlockByName(name, networkSecurityGroupResourceName)

sg := network.SecurityGroup{
Name: &name,
Location: &location,
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_virtual_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ func resourceArmVirtualNetworkCreate(d *schema.ResourceData, meta interface{}) e
}
}

azureRMLockMultipleByName(&networkSecurityGroupNames, virtualNetworkResourceName)
defer azureRMUnlockMultipleByName(&networkSecurityGroupNames, virtualNetworkResourceName)
azureRMLockMultipleByName(&networkSecurityGroupNames, networkSecurityGroupResourceName)
defer azureRMUnlockMultipleByName(&networkSecurityGroupNames, networkSecurityGroupResourceName)

_, error := vnetClient.CreateOrUpdate(resGroup, name, vnet, make(chan struct{}))
err := <-error
Expand Down

0 comments on commit bcb5c86

Please sign in to comment.