Merge pull request #11742 from rainzm/automated-cherry-pick-of-#11741-upstream-release-3.7

Automated cherry pick of #11741: fix(region): prevent the creation of redundant network segments when managing vmware
This commit is contained in:
Zexi Li
2021-07-29 16:38:48 +08:00
committed by GitHub
@@ -216,6 +216,9 @@ func (self *CloudAccountSyncVMwareNetworkTask) createNetworks(ctx context.Contex
var err error
ret := make(map[string][]models.SVs2Wire)
for i := range capWires {
if len(capWires[i].GuestNetworks)+len(capWires[i].HostNetworks) == 0 {
continue
}
var wireId = capWires[i].WireId
if len(wireId) == 0 {
wireId, err = self.createWire(ctx, cloudaccount, api.DEFAULT_VPC_ID, zoneId, capWires[i].Name, capWires[i].Description)