Merge pull request #2215 from hashicorp/b-route-cidr-block-optional

provider/aws: fix panic when route has no cidr_block
This commit is contained in:
Paul Hinze 2015-06-03 14:19:22 -05:00
commit 328db1c418
1 changed files with 4 additions and 1 deletions

View File

@ -361,7 +361,10 @@ func resourceAwsRouteTableDelete(d *schema.ResourceData, meta interface{}) error
func resourceAwsRouteTableHash(v interface{}) int { func resourceAwsRouteTableHash(v interface{}) int {
var buf bytes.Buffer var buf bytes.Buffer
m := v.(map[string]interface{}) m := v.(map[string]interface{})
buf.WriteString(fmt.Sprintf("%s-", m["cidr_block"].(string)))
if v, ok := m["cidr_block"]; ok {
buf.WriteString(fmt.Sprintf("%s-", v.(string)))
}
if v, ok := m["gateway_id"]; ok { if v, ok := m["gateway_id"]; ok {
buf.WriteString(fmt.Sprintf("%s-", v.(string))) buf.WriteString(fmt.Sprintf("%s-", v.(string)))