providers/aws: use GetOk to check for value [GH-258]

This commit is contained in:
Mitchell Hashimoto 2014-09-08 20:24:43 -07:00
parent cc1bf78850
commit ab5e07a1f9
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ IMPROVEMENTS:
BUG FIXES: BUG FIXES:
* core: Fix certain syntax of configuration that could cause hang. [GH-261] * core: Fix certain syntax of configuration that could cause hang. [GH-261]
* providers/aws: Refreshing EIP from pre-0.2 state file won't error. [GH-258]
* providers/google: Attaching a disk source (not an image) works * providers/google: Attaching a disk source (not an image) works
properly. [GH-254] properly. [GH-254]

View File

@ -185,7 +185,7 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error {
} }
func resourceAwsEipDomain(d *schema.ResourceData) string { func resourceAwsEipDomain(d *schema.ResourceData) string {
if v := d.Get("domain"); v != nil { if v, ok := d.GetOk("domain"); ok {
return v.(string) return v.(string)
} else if strings.Contains(d.Id(), "eipalloc") { } else if strings.Contains(d.Id(), "eipalloc") {
// We have to do this for backwards compatibility since TF 0.1 // We have to do this for backwards compatibility since TF 0.1