Skip to content

Commit

Permalink
fix: handle vnet gw change (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
pogossian authored Nov 18, 2023
1 parent 3be7499 commit d99068b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions netris/vnet/vnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,19 +517,20 @@ func resourceRead(d *schema.ResourceData, m interface{}) error {
}
}
if siteID == site.ID {
m := gatewayMap[gateway.Prefix]
m["prefix"] = gateway.Prefix
m["vlanid"] = gateway.Vlan
m["dhcp"] = "disabled"
if gateway.DHCPEnabled {
m["dhcp"] = "enabled"
if m["dhcpstartip"].(string) != "" {
m["dhcpoptionsetid"] = gateway.DHCP.OptionSet.ID
m["dhcpstartip"] = gateway.DHCP.Start
m["dhcpendip"] = gateway.DHCP.End
if m, ok := gatewayMap[gateway.Prefix]; ok {
m["prefix"] = gateway.Prefix
m["vlanid"] = gateway.Vlan
m["dhcp"] = "disabled"
if gateway.DHCPEnabled {
m["dhcp"] = "enabled"
if m["dhcpstartip"].(string) != "" {
m["dhcpoptionsetid"] = gateway.DHCP.OptionSet.ID
m["dhcpstartip"] = gateway.DHCP.Start
m["dhcpendip"] = gateway.DHCP.End
}
}
gatewayList = append(gatewayList, m)
}
gatewayList = append(gatewayList, m)
}
}
s["id"] = site.ID
Expand Down

0 comments on commit d99068b

Please sign in to comment.