Skip to content

Commit

Permalink
handle duplicate portgroups
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-jmattson committed Nov 19, 2024
1 parent 7773aec commit fc76028
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/TopoMojo.Hypervisor/vSphere/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task Initialize()
foreach (var pg in existing)
pg.Timestamp = ts;

_pgAllocation = existing.ToDictionary(p => p.Net);
_pgAllocation = existing.DistinctBy(p => p.Net).ToDictionary(p => p.Net);

_vlanManager.Activate(
_pgAllocation.Values.Select(p => new Vlan
Expand Down
3 changes: 3 additions & 0 deletions src/TopoMojo.Hypervisor/vSphere/NsxNetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ config.defaultPortConfig is VMwareDVSPortSetting setting
}
}

string info = string.Join('\n', [.. list.Select(p => $"{p.Net}::{p.Key}")]);
_logger.LogDebug("{info}", info);

return [.. list];
}

Expand Down

0 comments on commit fc76028

Please sign in to comment.