mirror of
https://github.com/kemko/xc.git
synced 2026-01-01 15:55:43 +03:00
dctree filter
This commit is contained in:
@@ -202,6 +202,7 @@ func (s *Store) HostList(expr []rune) ([]string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
etoken.hosts = append(etoken.hosts, host)
|
etoken.hosts = append(etoken.hosts, host)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,8 +217,18 @@ func (s *Store) HostList(expr []rune) ([]string, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if host.Datacenter.Name != token.DatacenterFilter {
|
if host.Datacenter.Name != token.DatacenterFilter {
|
||||||
// TODO tree
|
hostDC := host.Datacenter.Parent
|
||||||
continue
|
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
|
continue
|
||||||
}
|
}
|
||||||
if host.Datacenter.Name != token.DatacenterFilter {
|
if host.Datacenter.Name != token.DatacenterFilter {
|
||||||
// TODO tree
|
hostDC := host.Datacenter.Parent
|
||||||
continue
|
parentMatch := false
|
||||||
|
for hostDC != nil {
|
||||||
|
if hostDC.Name == token.DatacenterFilter {
|
||||||
|
parentMatch = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
hostDC = hostDC.Parent
|
||||||
|
}
|
||||||
|
if !parentMatch {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user