Index: appengine/logdog/coordinator/hierarchy/project.go |
diff --git a/appengine/logdog/coordinator/hierarchy/project.go b/appengine/logdog/coordinator/hierarchy/project.go |
index 70398b4c618acd0b6770c50feebbea1d0e9b4744..bd2bc036324650dbdaae38e7d97bdfa40c270c05 100644 |
--- a/appengine/logdog/coordinator/hierarchy/project.go |
+++ b/appengine/logdog/coordinator/hierarchy/project.go |
@@ -6,7 +6,6 @@ package hierarchy |
import ( |
"github.com/luci/luci-go/appengine/logdog/coordinator" |
- "github.com/luci/luci-go/appengine/logdog/coordinator/config" |
luciConfig "github.com/luci/luci-go/common/config" |
log "github.com/luci/luci-go/common/logging" |
"golang.org/x/net/context" |
@@ -19,32 +18,12 @@ func getProjects(c context.Context, r *Request) (*List, error) { |
return &l, nil |
} |
- projects, err := config.UserProjects(c) |
- if err != nil { |
- log.WithError(err).Errorf(c, "Failed to get user projects.") |
- return nil, err |
- } |
- |
- // Get all current datastore namespaces. |
- nsProjects, err := coordinator.AllProjectsWithNamespaces(c) |
+ // Get all user-accessible active projects. |
+ projects, err := coordinator.ActiveProjects(c, true) |
if err != nil { |
// If there is an error, we will refrain from filtering projects. |
- log.WithError(err).Warningf(c, "Failed to get namespace project list.") |
- } else { |
- // Only list projects that have datastore namespaces. |
- lookup := make(map[luciConfig.ProjectName]struct{}, len(nsProjects)) |
- for _, proj := range nsProjects { |
- lookup[proj] = struct{}{} |
- } |
- |
- pos := 0 |
- for _, proj := range projects { |
- if _, ok := lookup[proj]; ok { |
- projects[pos] = proj |
- pos++ |
- } |
- } |
- projects = projects[:pos] |
+ log.WithError(err).Warningf(c, "Failed to get project list.") |
+ return nil, err |
} |
next := luciConfig.ProjectName(r.Next) |