Skip to content

Commit

Permalink
Fixing a bug in VM Extension if the RG didn't exist (#11894)
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff authored and stack72 committed Feb 12, 2017
1 parent 7e39cc5 commit 03c11f8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ func resourceArmVirtualMachineExtensionsRead(d *schema.ResourceData, meta interf
name := id.Path["extensions"]

resp, err := client.Get(resGroup, vmName, name, "")

if err != nil {
if resp.StatusCode == http.StatusNotFound {
d.SetId("")
return nil
}
return fmt.Errorf("Error making Read request on Virtual Machine Extension %s: %s", name, err)
}
if resp.StatusCode == http.StatusNotFound {
d.SetId("")
return nil
}

d.Set("name", resp.Name)
d.Set("location", azureRMNormalizeLocation(*resp.Location))
Expand Down

0 comments on commit 03c11f8

Please sign in to comment.