fix aliases cleanup

This commit is contained in:
Martin Geno 2016-06-19 12:49:44 +02:00
parent ffa9c1ba92
commit 9049b6d937

View File

@ -35,11 +35,12 @@ func (api *ApiAliases) cleaner() {
//counter for the diffrent attribute //counter for the diffrent attribute
count := 0 count := 0
if nodeinfo := node.Nodeinfo; nodeinfo != nil { if nodeinfo := node.Nodeinfo; nodeinfo != nil {
count += 3 count += 1
if alias.Hostname == nodeinfo.Hostname { if alias.Hostname == nodeinfo.Hostname {
count -= 1 count -= 1
} }
if alias.Location != nil && nodeinfo.Location != nil { if alias.Location != nil && nodeinfo.Location != nil {
count += 2
if alias.Location.Latitude == nodeinfo.Location.Latitude { if alias.Location.Latitude == nodeinfo.Location.Latitude {
count -= 1 count -= 1
} }