[ARVADOS] updated: b27f1106beb0fb321ee123501afb5ccf2354a363

Git user git at public.curoverse.com
Wed Dec 28 10:27:34 EST 2016


Summary of changes:
 services/keep-balance/keep-balance.service | 2 +-
 services/keep-balance/main.go              | 7 +++----
 services/keep-balance/usage.go             | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

       via  b27f1106beb0fb321ee123501afb5ccf2354a363 (commit)
      from  fe060158c380fe92635cae24a12eb43680021169 (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 b27f1106beb0fb321ee123501afb5ccf2354a363
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Dec 28 10:21:25 2016 -0500

    Load keep-balance config from default location if -config arg not given.
    
    No issue #

diff --git a/services/keep-balance/keep-balance.service b/services/keep-balance/keep-balance.service
index 157e42c..a6f5b6e 100644
--- a/services/keep-balance/keep-balance.service
+++ b/services/keep-balance/keep-balance.service
@@ -6,7 +6,7 @@ AssertPathExists=/etc/arvados/keep-balance/keep-balance.yml
 
 [Service]
 Type=simple
-ExecStart=/usr/bin/keep-balance -config /etc/arvados/keep-balance/keep-balance.yml -commit-pulls -commit-trash
+ExecStart=/usr/bin/keep-balance -commit-pulls -commit-trash
 Restart=always
 RestartSec=10s
 
diff --git a/services/keep-balance/main.go b/services/keep-balance/main.go
index 60349e9..310c77a 100644
--- a/services/keep-balance/main.go
+++ b/services/keep-balance/main.go
@@ -13,6 +13,8 @@ import (
 	"git.curoverse.com/arvados.git/sdk/go/config"
 )
 
+const defaultConfigPath = "/etc/arvados/keep-balance/keep-balance.yml"
+
 // Config specifies site configuration, like API credentials and the
 // choice of which servers are to be balanced.
 //
@@ -65,7 +67,7 @@ func main() {
 	var config Config
 	var runOptions RunOptions
 
-	configPath := flag.String("config", "",
+	configPath := flag.String("config", defaultConfigPath,
 		"`path` of JSON or YAML configuration file")
 	serviceListPath := flag.String("config.KeepServiceList", "",
 		"`path` of JSON or YAML file with list of keep services to balance, as given by \"arv keep_service list\" "+
@@ -81,9 +83,6 @@ func main() {
 	flag.Usage = usage
 	flag.Parse()
 
-	if *configPath == "" {
-		log.Fatal("You must specify a config file (see `keep-balance -help`)")
-	}
 	mustReadConfig(&config, *configPath)
 	if *serviceListPath != "" {
 		mustReadConfig(&config.KeepServiceList, *serviceListPath)
diff --git a/services/keep-balance/usage.go b/services/keep-balance/usage.go
index d112010..6f48af1 100644
--- a/services/keep-balance/usage.go
+++ b/services/keep-balance/usage.go
@@ -26,7 +26,7 @@ overreplicated and unreferenced blocks, and moves blocks to better
 positions (according to the rendezvous hash algorithm) so clients find
 them faster.
 
-Usage: keep-balance -config path/to/keep-balance.yml [options]
+Usage: keep-balance [options]
 
 Options:
 `)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list