This commit is contained in:
asteam
2025-07-18 16:54:16 +03:00
parent e04dab77cb
commit 1b81a71504
10 changed files with 20 additions and 75 deletions

View File

@@ -397,15 +397,12 @@ func differenceNetwork(oldList, newList []interface{}) (detachMap, changeIpMap,
newMap := newNetwork.(map[string]interface{})
if newMap["net_type"] == oldMap["net_type"] && newMap["net_id"] == oldMap["net_id"] && newMap["weight"] == oldMap["weight"] && (newMap["mtu"] == oldMap["mtu"] || newMap["mtu"].(int) == 0) {
found = true
switch {
case (newMap["net_type"].(string) == "EXTNET" || newMap["net_type"].(string) == "VINS") && (newMap["ip_address"] != oldMap["ip_address"] && newMap["ip_address"].(string) != ""):
if (newMap["net_type"].(string) == "EXTNET" || newMap["net_type"].(string) == "VINS") && (newMap["ip_address"] != oldMap["ip_address"] && newMap["ip_address"].(string) != "") {
changeIpMap = append(changeIpMap, newMap)
found = true
fallthrough
case newMap["mac"] != oldMap["mac"] && newMap["mac"].(string) != "":
}
if newMap["mac"] != oldMap["mac"] && newMap["mac"].(string) != "" {
newMap["old_mac"] = oldMap["mac"]
changeMacMap = append(changeMacMap, newMap)
found = true
}
}
if found {