[ARVADOS] created: 6e930024dbfe00237685d19224d026bd670db05a

Git user git at public.curoverse.com
Sat Nov 12 17:25:25 EST 2016


        at  6e930024dbfe00237685d19224d026bd670db05a (commit)


commit 6e930024dbfe00237685d19224d026bd670db05a
Author: Tom Clegg <tom at curoverse.com>
Date:   Sat Nov 12 17:25:16 2016 -0500

    10470: Load config from default location if -config arg not given.

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