From 6eb2d12a2e690e415d7c9a39bb65260699743962 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Tue, 14 Apr 2020 09:18:03 +0200 Subject: [PATCH] Fix list attributes in segment read action --- nsxt/segment_common.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nsxt/segment_common.go b/nsxt/segment_common.go index e4447c42d..3f317a894 100644 --- a/nsxt/segment_common.go +++ b/nsxt/segment_common.go @@ -676,14 +676,20 @@ func nsxtPolicySegmentRead(d *schema.ResourceData, m interface{}, isVlan bool) e if obj.AdvancedConfig.UplinkTeamingPolicyName != nil { advConfig["uplink_teaming_policy"] = *obj.AdvancedConfig.UplinkTeamingPolicyName } - d.Set("advanced_config", advConfig) + // This is a list with 1 element + var advConfigList []map[string]interface{} + advConfigList = append(advConfigList, advConfig) + d.Set("advanced_config", advConfigList) } if obj.L2Extension != nil { l2Ext := make(map[string]interface{}) l2Ext["l2vpn_paths"] = obj.L2Extension.L2vpnPaths l2Ext["tunnel_id"] = obj.L2Extension.TunnelId - d.Set("l2_extension", l2Ext) + // This is a list with 1 element + var l2ExtList []map[string]interface{} + l2ExtList = append(l2ExtList, l2Ext) + d.Set("l2_extension", l2ExtList) } var subnetSegments []interface{}