Skip to content

Commit 78ebd66

Browse files
committed
Fix traffic type import due to incorrect parameter
1 parent f0615b8 commit 78ebd66

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

cloudstack/resource_cloudstack_traffic_type.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,8 @@ func resourceCloudStackTrafficTypeRead(d *schema.ResourceData, meta interface{})
167167
return nil
168168
}
169169

170-
// The TrafficType struct has a Name field which contains the traffic type
171-
// But in some cases it might be empty, so we'll keep the original value from the state
172-
if trafficType.Name != "" {
173-
d.Set("traffic_type", trafficType.Name)
170+
if trafficType.Traffictype != "" {
171+
d.Set("traffic_type", trafficType.Traffictype)
174172
}
175173

176174
// Note: The TrafficType struct doesn't have fields for network labels or VLAN
@@ -266,9 +264,9 @@ func resourceCloudStackTrafficTypeImport(d *schema.ResourceData, meta interface{
266264
d.Set("physical_network_id", pn.Id)
267265

268266
// Set the type attribute - use the original value from the API call
269-
// If the Name field is empty, use a default value based on the traffic type ID
270-
if tt.Name != "" {
271-
d.Set("traffic_type", tt.Name)
267+
// If the Traffictype field is empty, use a default value based on the traffic type ID
268+
if tt.Traffictype != "" {
269+
d.Set("traffic_type", tt.Traffictype)
272270
} else {
273271
// Use a default value based on common traffic types
274272
// This is a fallback and might not be accurate

0 commit comments

Comments
 (0)