skip same host

This commit is contained in:
Abhishek Kondur
2023-01-10 19:54:43 +05:30
parent 599656618d
commit e322ccee09

View File

@@ -299,6 +299,9 @@ func GetRelatedHosts(hostID string) []models.Host {
hosts, err := GetAllHosts() hosts, err := GetAllHosts()
if err == nil { if err == nil {
for _, host := range hosts { for _, host := range hosts {
if host.ID.String() == hostID {
continue
}
networks := GetHostNetworks(host.ID.String()) networks := GetHostNetworks(host.ID.String())
for _, network := range networks { for _, network := range networks {
if _, ok := networkMap[network]; ok { if _, ok := networkMap[network]; ok {