fix bug in SessionPersistence logic

This commit is contained in:
Jon Perritt 2015-01-26 11:38:33 -07:00
parent 9b54c569cc
commit 46a7949c9d
1 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ func resourceLBVipV1() *schema.Resource {
ForceNew: false,
},
"persistence": &schema.Schema{
Type: schema.TypeString,
Type: schema.TypeMap,
Optional: true,
ForceNew: false,
},
@ -265,7 +265,7 @@ func resourceLBVipV1Delete(d *schema.ResourceData, meta interface{}) error {
func resourceVipPersistenceV1(d *schema.ResourceData) *vips.SessionPersistence {
rawP := d.Get("persistence").(interface{})
rawMap := rawP.(map[string]interface{})
if rawMap != nil {
if len(rawMap) != 0 {
p := vips.SessionPersistence{}
if t, ok := rawMap["type"]; ok {
p.Type = t.(string)