Skip to content

Commit

Permalink
fix issue hashicorp#218
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Vlasov committed Aug 15, 2017
1 parent eaf5248 commit 8a3af76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion google/resource_compute_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ func resourceComputeDiskRead(d *schema.ResourceData, meta interface{}) error {
imageUrlParts := strings.Split(disk.SourceImage, "/")
d.Set("image", imageUrlParts[len(imageUrlParts)-1])
}
d.Set("snapshot", disk.SourceSnapshot)

if disk.SourceSnapshot != "" {
snapshotUrlParts := strings.Split(disk.SourceSnapshot, "/")
d.Set("snapshot", snapshotUrlParts[len(snapshotUrlParts)-1])
}

return nil
}
Expand Down

0 comments on commit 8a3af76

Please sign in to comment.