[ARVADOS] updated: 2.1.0-917-g38218a359
Git user
git at public.arvados.org
Thu Jun 10 20:18:48 UTC 2021
Summary of changes:
lib/costanalyzer/cmd.go | 2 +-
lib/costanalyzer/costanalyzer.go | 32 ++++++++++++++++----------------
lib/deduplicationreport/command.go | 10 ++--------
3 files changed, 19 insertions(+), 25 deletions(-)
via 38218a359786e327bbd4f3379be19e25a5a005f9 (commit)
via ea1ade46c416421aabaa585d1df774e042967839 (commit)
from 08c8b9cc496627bc3fd3d87ae333fadce4797eaa (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 38218a359786e327bbd4f3379be19e25a5a005f9
Author: Tom Clegg <tom at curii.com>
Date: Thu Jun 10 16:06:22 2021 -0400
17609: Remove extra newlines.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/costanalyzer/cmd.go b/lib/costanalyzer/cmd.go
index 633e95e29..b08e943c0 100644
--- a/lib/costanalyzer/cmd.go
+++ b/lib/costanalyzer/cmd.go
@@ -23,7 +23,7 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s
logger.SetFormatter(cmd.NoPrefixFormatter{})
defer func() {
if err != nil {
- logger.Error("\n" + err.Error() + "\n")
+ logger.Error("\n" + err.Error())
}
}()
diff --git a/lib/costanalyzer/costanalyzer.go b/lib/costanalyzer/costanalyzer.go
index 71cb59093..23df754bc 100644
--- a/lib/costanalyzer/costanalyzer.go
+++ b/lib/costanalyzer/costanalyzer.go
@@ -9,10 +9,6 @@ import (
"errors"
"flag"
"fmt"
- "git.arvados.org/arvados.git/lib/config"
- "git.arvados.org/arvados.git/sdk/go/arvados"
- "git.arvados.org/arvados.git/sdk/go/arvadosclient"
- "git.arvados.org/arvados.git/sdk/go/keepclient"
"io"
"io/ioutil"
"net/http"
@@ -21,6 +17,10 @@ import (
"strings"
"time"
+ "git.arvados.org/arvados.git/lib/config"
+ "git.arvados.org/arvados.git/sdk/go/arvados"
+ "git.arvados.org/arvados.git/sdk/go/arvadosclient"
+ "git.arvados.org/arvados.git/sdk/go/keepclient"
"github.com/sirupsen/logrus"
)
@@ -140,7 +140,7 @@ Options:
}
logger.SetLevel(lvl)
if !cache {
- logger.Debug("Caching disabled\n")
+ logger.Debug("Caching disabled")
}
return
}
@@ -220,12 +220,12 @@ func loadCachedObject(logger *logrus.Logger, file string, uuid string, object in
case *arvados.ContainerRequest:
if v.State == arvados.ContainerRequestStateFinal {
reload = false
- logger.Debugf("Loaded object %s from local cache (%s)\n", uuid, file)
+ logger.Debugf("Loaded object %s from local cache (%s)", uuid, file)
}
case *arvados.Container:
if v.State == arvados.ContainerStateComplete || v.State == arvados.ContainerStateCancelled {
reload = false
- logger.Debugf("Loaded object %s from local cache (%s)\n", uuid, file)
+ logger.Debugf("Loaded object %s from local cache (%s)", uuid, file)
}
}
return
@@ -355,7 +355,7 @@ func handleProject(logger *logrus.Logger, uuid string, arv *arvadosclient.Arvado
return nil, fmt.Errorf("error querying container_requests: %s", err.Error())
}
if value, ok := childCrs["items"]; ok {
- logger.Infof("Collecting top level container requests in project %s\n", uuid)
+ logger.Infof("Collecting top level container requests in project %s", uuid)
items := value.([]interface{})
for _, item := range items {
itemMap := item.(map[string]interface{})
@@ -368,7 +368,7 @@ func handleProject(logger *logrus.Logger, uuid string, arv *arvadosclient.Arvado
}
}
} else {
- logger.Infof("No top level container requests found in project %s\n", uuid)
+ logger.Infof("No top level container requests found in project %s", uuid)
}
return
}
@@ -408,7 +408,7 @@ func generateCrCsv(logger *logrus.Logger, uuid string, arv *arvadosclient.Arvado
}
if len(cr.ContainerUUID) == 0 {
// Nothing to do! E.g. a CR in 'Uncommitted' state.
- logger.Infof("No container associated with container request %s, skipping\n", crUUID)
+ logger.Infof("No container associated with container request %s, skipping", crUUID)
return nil, nil
}
var container arvados.Container
@@ -448,7 +448,7 @@ func generateCrCsv(logger *logrus.Logger, uuid string, arv *arvadosclient.Arvado
if err != nil {
return nil, fmt.Errorf("error getting node %s: %s", cr2.UUID, err)
}
- logger.Debug("\nChild container: " + cr2.ContainerUUID + "\n")
+ logger.Debug("\nChild container: " + cr2.ContainerUUID)
var c2 arvados.Container
err = loadObject(logger, ac, cr.UUID, cr2.ContainerUUID, cache, &c2)
if err != nil {
@@ -459,7 +459,7 @@ func generateCrCsv(logger *logrus.Logger, uuid string, arv *arvadosclient.Arvado
csv += tmpCsv
totalCost += tmpTotalCost
}
- logger.Info(" done\n")
+ logger.Info(" done")
csv += "TOTAL,,,,,,,,," + strconv.FormatFloat(totalCost, 'f', 8, 64) + "\n"
@@ -470,7 +470,7 @@ func generateCrCsv(logger *logrus.Logger, uuid string, arv *arvadosclient.Arvado
if err != nil {
return nil, fmt.Errorf("error writing file with path %s: %s", fName, err.Error())
}
- logger.Infof("\nUUID report in %s\n\n", fName)
+ logger.Infof("\nUUID report in %s\n", fName)
}
return
@@ -536,14 +536,14 @@ func costanalyzer(prog string, args []string, loader *config.Loader, logger *log
// keep going.
logger.Errorf("cost analysis is not supported for the 'Home' project: %s", uuid)
} else {
- logger.Errorf("this argument does not look like a uuid: %s\n", uuid)
+ logger.Errorf("this argument does not look like a uuid: %s", uuid)
exitcode = 3
return
}
}
if len(cost) == 0 {
- logger.Info("Nothing to do!\n")
+ logger.Info("Nothing to do!")
return
}
@@ -571,7 +571,7 @@ func costanalyzer(prog string, args []string, loader *config.Loader, logger *log
exitcode = 1
return
}
- logger.Infof("Aggregate cost accounting for all supplied uuids in %s\n", aFile)
+ logger.Infof("Aggregate cost accounting for all supplied uuids in %s", aFile)
}
// Output the total dollar amount on stdout
commit ea1ade46c416421aabaa585d1df774e042967839
Author: Tom Clegg <tom at curii.com>
Date: Thu Jun 10 15:57:44 2021 -0400
17609: Remove duplicate NoPrefixFormatter.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/deduplicationreport/command.go b/lib/deduplicationreport/command.go
index 93cdb61d3..39bbbc949 100644
--- a/lib/deduplicationreport/command.go
+++ b/lib/deduplicationreport/command.go
@@ -7,20 +7,14 @@ package deduplicationreport
import (
"io"
+ "git.arvados.org/arvados.git/lib/cmd"
"git.arvados.org/arvados.git/sdk/go/ctxlog"
- "github.com/sirupsen/logrus"
)
var Command command
type command struct{}
-type NoPrefixFormatter struct{}
-
-func (f *NoPrefixFormatter) Format(entry *logrus.Entry) ([]byte, error) {
- return []byte(entry.Message + "\n"), nil
-}
-
// RunCommand implements the subcommand "deduplication-report <collection> <collection> ..."
func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
var err error
@@ -31,7 +25,7 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s
}
}()
- logger.SetFormatter(new(NoPrefixFormatter))
+ logger.SetFormatter(cmd.NoPrefixFormatter{})
exitcode := report(prog, args, logger, stdout, stderr)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list