mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-15 13:21:14 +08:00
fix node update
This commit is contained in:
@@ -63,26 +63,6 @@ func GetHostsMap() (map[string]*models.Host, error) {
|
||||
return currHostMap, nil
|
||||
}
|
||||
|
||||
func GetNetworkHosts(network string) ([]models.Host, error) {
|
||||
networkHosts := []models.Host{}
|
||||
hosts, err := GetAllHosts()
|
||||
if err != nil {
|
||||
return networkHosts, err
|
||||
}
|
||||
for _, host := range hosts {
|
||||
for _, nodeID := range host.Nodes {
|
||||
node, err := GetNodeByID(nodeID)
|
||||
if err == nil {
|
||||
if node.Network == network {
|
||||
networkHosts = append(networkHosts, host)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return networkHosts, nil
|
||||
}
|
||||
|
||||
// GetHost - gets a host from db given id
|
||||
func GetHost(hostid string) (*models.Host, error) {
|
||||
record, err := database.FetchRecord(database.HOSTS_TABLE_NAME, hostid)
|
||||
|
Reference in New Issue
Block a user