| Index: go/src/infra/tools/kitchen/kitchen.go
|
| diff --git a/go/src/infra/tools/kitchen/kitchen.go b/go/src/infra/tools/kitchen/kitchen.go
|
| index 69b16dcc623dff50892826a041c1b25f5c071843..68bd7d31dd9d6ec93f262482f8895e50a153db41 100644
|
| --- a/go/src/infra/tools/kitchen/kitchen.go
|
| +++ b/go/src/infra/tools/kitchen/kitchen.go
|
| @@ -13,6 +13,7 @@ import (
|
| "golang.org/x/net/context"
|
|
|
| "github.com/luci/luci-go/common/cli"
|
| + "github.com/luci/luci-go/common/environ"
|
| "github.com/luci/luci-go/common/errors"
|
| log "github.com/luci/luci-go/common/logging"
|
| "github.com/luci/luci-go/common/logging/gologger"
|
| @@ -68,3 +69,18 @@ func logAnnotatedErr(ctx context.Context, err error) {
|
|
|
| log.Errorf(ctx, "Annotated error stack:\n%s", buf.String())
|
| }
|
| +
|
| +// getSwarmingTaskParameters retrieves the Swarming task parameters from the
|
| +// environment.
|
| +func getSwarmingTaskParameters(env environ.Env) (host, taskID string, err error) {
|
| + if host, _ = env.Get("SWARMING_SERVER"); host == "" {
|
| + err = errors.Reason("missing or empty SWARMING_SERVER").Err()
|
| + return
|
| + }
|
| + if taskID, _ = env.Get("SWARMING_TASK_ID"); taskID == "" {
|
| + err = errors.Reason("missing SWARMING_TASK_ID").Err()
|
| + return
|
| + }
|
| +
|
| + return
|
| +}
|
|
|