[arvados] updated: 2.1.0-2947-gc1af8a9ad

git repository hosting git at public.arvados.org
Thu Oct 6 18:25:06 UTC 2022


Summary of changes:
 doc/_config.yml                                    |  5 +-
 doc/admin/group-management.html.textile.liquid     | 20 +++---
 .../install-dispatch.html.textile.liquid           | 39 ++++++++--
 doc/sdk/python/cookbook.html.textile.liquid        | 82 ++++++++++++++++------
 lib/lsf/dispatch.go                                | 35 ++++-----
 lib/lsf/dispatch_test.go                           | 60 ++++++++++++----
 sdk/go/health/aggregator.go                        |  8 ++-
 sdk/go/health/aggregator_test.go                   |  7 ++
 tools/user-activity/arvados_user_activity/main.py  | 31 ++++----
 9 files changed, 196 insertions(+), 91 deletions(-)

       via  c1af8a9ad9d5d8fc0e6bf49ad2bcc9119c85bfdc (commit)
       via  a33307464566191161d3a7264df70de14d064fd7 (commit)
       via  0b163998fa735e2673e499f075aa62204e7ee77e (commit)
       via  88f14b14041489485bb462b1701bb4b376a35595 (commit)
       via  055d9f503f719bf9aad95c57a2fa435f83537318 (commit)
       via  ed218eff47b6784b6c40fa919491d78fa78d1a19 (commit)
       via  e71e91157b526302209973f104307b0ef1a2c2cd (commit)
      from  fe5fc284f0dd1cdd0c01922a98bcf75b4186e80a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c1af8a9ad9d5d8fc0e6bf49ad2bcc9119c85bfdc
Author: Tom Clegg <tom at curii.com>
Date:   Thu Oct 6 14:14:31 2022 -0400

    19377: Say "health check OK" on success.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/sdk/go/health/aggregator.go b/sdk/go/health/aggregator.go
index caf99108a..63e0b0d90 100644
--- a/sdk/go/health/aggregator.go
+++ b/sdk/go/health/aggregator.go
@@ -438,7 +438,7 @@ func (ccmd checkCommand) RunCommand(prog string, args []string, stdin io.Reader,
 	err := ccmd.run(ctx, prog, args, stdin, stdout, stderr)
 	if err != nil {
 		if err != errSilent {
-			fmt.Fprintln(stdout, err.Error())
+			fmt.Fprintln(stderr, err.Error())
 		}
 		return 1
 	}
@@ -452,6 +452,7 @@ func (ccmd checkCommand) run(ctx context.Context, prog string, args []string, st
 	loader.SetupFlags(flags)
 	versionFlag := flags.Bool("version", false, "Write version information to stdout and exit 0")
 	timeout := flags.Duration("timeout", defaultTimeout.Duration(), "Maximum time to wait for health responses")
+	quiet := flags.Bool("quiet", false, "Silent on success (suppress 'health check OK' message on stderr)")
 	outputYAML := flags.Bool("yaml", false, "Output full health report in YAML format (default mode shows errors as plain text, is silent on success)")
 	if ok, _ := cmd.ParseFlags(flags, prog, args, "", stderr); !ok {
 		// cmd.ParseFlags already reported the error
@@ -487,11 +488,14 @@ func (ccmd checkCommand) run(ctx context.Context, prog string, args []string, st
 	}
 	if resp.Health != "OK" {
 		for _, msg := range resp.Errors {
-			fmt.Fprintln(stdout, msg)
+			fmt.Fprintln(stderr, msg)
 		}
 		fmt.Fprintln(stderr, "health check failed")
 		return errSilent
 	}
+	if !*quiet {
+		fmt.Fprintln(stderr, "health check OK")
+	}
 	return nil
 }
 
diff --git a/sdk/go/health/aggregator_test.go b/sdk/go/health/aggregator_test.go
index b1166c27d..f76f7b8ea 100644
--- a/sdk/go/health/aggregator_test.go
+++ b/sdk/go/health/aggregator_test.go
@@ -321,6 +321,13 @@ func (s *AggregatorSuite) TestCheckCommand(c *check.C) {
 
 	exitcode := CheckCommand.RunCommand("check", []string{"-config=" + tmpdir + "/config.yml"}, &bytes.Buffer{}, &stdout, &stderr)
 	c.Check(exitcode, check.Equals, 0)
+	c.Check(stderr.String(), check.Equals, "health check OK\n")
+	c.Check(stdout.String(), check.Equals, "")
+
+	stdout.Reset()
+	stderr.Reset()
+	exitcode = CheckCommand.RunCommand("check", []string{"-quiet", "-config=" + tmpdir + "/config.yml"}, &bytes.Buffer{}, &stdout, &stderr)
+	c.Check(exitcode, check.Equals, 0)
 	c.Check(stderr.String(), check.Equals, "")
 	c.Check(stdout.String(), check.Equals, "")
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list