(vms []*api.VM)
| 217 | } |
| 218 | |
| 219 | func uniqueSortedVMStatuses(vms []*api.VM) []string { |
| 220 | set := map[string]struct{}{} |
| 221 | for _, vm := range vms { |
| 222 | if vm == nil { |
| 223 | continue |
| 224 | } |
| 225 | status := strings.TrimSpace(vm.Status) |
| 226 | if status == "" { |
| 227 | continue |
| 228 | } |
| 229 | set[status] = struct{}{} |
| 230 | } |
| 231 | |
| 232 | out := make([]string, 0, len(set)) |
| 233 | for status := range set { |
| 234 | out = append(out, status) |
| 235 | } |
| 236 | sort.Strings(out) |
| 237 | |
| 238 | return out |
| 239 | } |
| 240 | |
| 241 | func uniqueSortedVMNodes(vms []*api.VM) []string { |
| 242 | set := map[string]struct{}{} |
no outgoing calls
no test coverage detected