| Index: logdog/appengine/coordinator/hierarchy/project.go
|
| diff --git a/logdog/appengine/coordinator/hierarchy/project.go b/logdog/appengine/coordinator/hierarchy/project.go
|
| index 0246aa813636c5e4256673aa7bda124c549286d2..7e150c10c9b80f85c778fbc14a290f3c0ca7a678 100644
|
| --- a/logdog/appengine/coordinator/hierarchy/project.go
|
| +++ b/logdog/appengine/coordinator/hierarchy/project.go
|
| @@ -5,12 +5,10 @@
|
| package hierarchy
|
|
|
| import (
|
| - "sort"
|
| -
|
| - "github.com/luci/luci-go/common/config"
|
| + commonConfig "github.com/luci/luci-go/common/config"
|
| log "github.com/luci/luci-go/common/logging"
|
| "github.com/luci/luci-go/grpc/grpcutil"
|
| - "github.com/luci/luci-go/logdog/appengine/coordinator"
|
| + "github.com/luci/luci-go/logdog/appengine/coordinator/config"
|
|
|
| "golang.org/x/net/context"
|
| )
|
| @@ -23,20 +21,14 @@ func getProjects(c context.Context, r *Request) (*List, error) {
|
| }
|
|
|
| // Get all user-accessible active projects.
|
| - allPcfgs, err := coordinator.ActiveUserProjects(c)
|
| + projects, err := config.ActiveUserProjects(c)
|
| if err != nil {
|
| // If there is an error, we will refrain from filtering projects.
|
| log.WithError(err).Warningf(c, "Failed to get user project list.")
|
| return nil, grpcutil.Internal
|
| }
|
|
|
| - projects := make(projectNameSlice, 0, len(allPcfgs))
|
| - for project := range allPcfgs {
|
| - projects = append(projects, project)
|
| - }
|
| - sort.Sort(projects)
|
| -
|
| - next := config.ProjectName(r.Next)
|
| + next := commonConfig.ProjectName(r.Next)
|
| skip := r.Skip
|
| for _, proj := range projects {
|
| // Implement "Next" cursor. If set, don't do anything until we've seen it.
|
| @@ -66,10 +58,3 @@ func getProjects(c context.Context, r *Request) (*List, error) {
|
|
|
| return &l, nil
|
| }
|
| -
|
| -// projectNameSlice is a sortable slice of config.ProjectName.
|
| -type projectNameSlice []config.ProjectName
|
| -
|
| -func (s projectNameSlice) Len() int { return len(s) }
|
| -func (s projectNameSlice) Less(i, j int) bool { return s[i] < s[j] }
|
| -func (s projectNameSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
|
|