Browse Source

skip same host

Abhishek Kondur 2 years ago
parent
commit
e322ccee09
1 changed files with 3 additions and 0 deletions
  1. 3 0
      logic/hosts.go

+ 3 - 0
logic/hosts.go

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