Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Unified Diff: common/tsmon/iface.go

Issue 2225933003: tsmon: read hostname and region from config file (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: common/tsmon/iface.go
diff --git a/common/tsmon/iface.go b/common/tsmon/iface.go
index 90559043aec0eb76fb554a9a685b9e45b0d6cb32..d9a0f548a54d6b7201900acc9533b62562f674bd 100644
--- a/common/tsmon/iface.go
+++ b/common/tsmon/iface.go
@@ -99,6 +99,14 @@ func InitializeFromFlags(c context.Context, fl *Flags) error {
if config.AutoGenHostname {
fl.Target.AutoGenHostname = true
}
+ if config.Hostname != "" {
+ fl.Target.DeviceHostname = config.Hostname
dsansome 2016/08/09 03:28:22 I would expect flags to override values from a con
Sergey Berezin 2016/08/10 01:49:16 Good catch, thanks! Done.
+ fl.Target.TaskHostname = config.Hostname
+ }
+ if config.Region != "" {
+ fl.Target.DeviceRegion = config.Region
+ fl.Target.TaskRegion = config.Region
+ }
fl.Target.SetDefaultsFromHostname()
t, err := target.NewFromFlags(&fl.Target)
if err != nil {

Powered by Google App Engine
This is Rietveld 408576698