From 61d19b79d93f97428c4eec1ca23b203714cabbea Mon Sep 17 00:00:00 2001 From: jaketaylor <jake@privategrity.com> Date: Fri, 19 Jul 2019 16:07:58 -0700 Subject: [PATCH] fix gateway input --- cmd/root.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 0e009b221..8dcdb81fc 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -133,18 +133,13 @@ func sessionInitialization() *id.User { client.SetRateLimiting(rateLimiting) // Handle parsing gateway addresses from the config file - gateways := viper.GetStringSlice("gateways") - if len(gwAddresses) < 1 { - // If gwAddr was not passed via command line, check config file - if len(gateways) < 1 { - // No gateways in config file or passed via command line - globals.Log.ERROR.Printf("Error: No gateway specified! Add to" + - " configuration file or pass via command line using -g!\n") - return id.ZeroID - } else { - // List of gateways found in config file - gwAddresses = gateways - } + gateways := ndfJSON.Gateways + // If gwAddr was not passed via command line, check config file + if len(gateways) < 1 { + // No gateways in config file or passed via command line + globals.Log.ERROR.Printf("Error: No gateway specified! Add to" + + " configuration file or pass via command line using -g!\n") + return id.ZeroID } // Connect to gateways and reg server -- GitLab