dctree filter

This commit is contained in:
Pavel Vorobyov
2020-07-03 11:55:29 +03:00
parent 4f12f5de04
commit a6fd56b667

View File

@@ -202,6 +202,7 @@ func (s *Store) HostList(expr []rune) ([]string, error) {
}
}
}
etoken.hosts = append(etoken.hosts, host)
}
@@ -216,8 +217,18 @@ func (s *Store) HostList(expr []rune) ([]string, error) {
continue
}
if host.Datacenter.Name != token.DatacenterFilter {
// TODO tree
continue
hostDC := host.Datacenter.Parent
parentMatch := false
for hostDC != nil {
if hostDC.Name == token.DatacenterFilter {
parentMatch = true
break
}
hostDC = hostDC.Parent
}
if !parentMatch {
continue
}
}
}
@@ -265,8 +276,18 @@ func (s *Store) HostList(expr []rune) ([]string, error) {
continue
}
if host.Datacenter.Name != token.DatacenterFilter {
// TODO tree
continue
hostDC := host.Datacenter.Parent
parentMatch := false
for hostDC != nil {
if hostDC.Name == token.DatacenterFilter {
parentMatch = true
break
}
hostDC = hostDC.Parent
}
if !parentMatch {
continue
}
}
}