@@ -51,9 +51,10 @@ func resourceCloudStackPhysicalNetwork() *schema.Resource {
5151 },
5252 "isolation_methods" : {
5353 Description : "the isolation method for the physical network[VLAN/L3/GRE]" ,
54- Type : schema .TypeString ,
54+ Type : schema .TypeList ,
5555 Optional : true ,
5656 ForceNew : true ,
57+ Elem : & schema.Schema {Type : schema .TypeString },
5758 },
5859 "name" : {
5960 Description : "the name of the physical network" ,
@@ -93,18 +94,27 @@ func resourceCloudStackPhysicalNetworkCreate(d *schema.ResourceData, meta interf
9394 if v , ok := d .GetOk ("broadcast_domain_range" ); ok {
9495 p .SetBroadcastdomainrange (strings .ToUpper (v .(string )))
9596 }
97+
9698 if v , ok := d .GetOk ("domain_id" ); ok {
9799 p .SetDomainid (v .(string ))
98100 }
99- if v , ok := d .GetOk ("isolation_methods" ); ok {
100- p .SetIsolationmethods ([]string {v .(string )})
101+
102+ if isolationMethods , ok := d .GetOk ("isolation_methods" ); ok {
103+ methods := make ([]string , len (isolationMethods .([]interface {})))
104+ for i , v := range isolationMethods .([]interface {}) {
105+ methods [i ] = v .(string )
106+ }
107+ p .SetIsolationmethods (methods )
101108 }
109+
102110 if v , ok := d .GetOk ("network_speed" ); ok {
103111 p .SetNetworkspeed (v .(string ))
104112 }
113+
105114 if v , ok := d .GetOk ("tags" ); ok {
106115 p .SetTags ([]string {v .(string )})
107116 }
117+
108118 if v , ok := d .GetOk ("vlan" ); ok {
109119 p .SetVlan (v .(string ))
110120 }
@@ -129,7 +139,11 @@ func resourceCloudStackPhysicalNetworkRead(d *schema.ResourceData, meta interfac
129139
130140 d .Set ("broadcast_domain_range" , p .Broadcastdomainrange )
131141 d .Set ("domain_id" , p .Domainid )
132- d .Set ("isolation_methods" , p .Isolationmethods )
142+ // Set isolation methods
143+ if p .Isolationmethods != "" {
144+ methods := strings .Split (p .Isolationmethods , "," )
145+ d .Set ("isolation_methods" , methods )
146+ }
133147 d .Set ("name" , p .Name )
134148 d .Set ("network_speed" , p .Networkspeed )
135149 d .Set ("tags" , p .Tags )
0 commit comments