Skip to content
Snippets Groups Projects

Process response overhaul

Merged Ghost User requested to merge process-response-overhaul into develop
6 files
+ 17
16
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 4
11
@@ -44,13 +44,9 @@ import (
)
var cfgFile string
var username string
var password string
var address string
var loglevel string
var grpcPort string
var cliPnd string
var cliSbi string
var csbiOrchestrstor string
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
@@ -78,12 +74,10 @@ func init() {
cobra.OnInitialize(initConfig)
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./configs/gosdn.toml)")
rootCmd.PersistentFlags().StringVarP(&username, "username", "u", "admin", "username for a gnmi resource")
rootCmd.PersistentFlags().StringVarP(&password, "password", "p", "arista", "password for a gnmi resource")
rootCmd.PersistentFlags().StringVarP(&address, "address", "a", "ceos-cocsn.apps.ocp.fbi.h-da.de:6030", "address of a gnmi target")
rootCmd.PersistentFlags().StringVarP(&loglevel, "log-level", "l", "", "log level 'debug' or 'trace'")
rootCmd.Flags().StringVar(&grpcPort, "grpc-port", "55055", "port for gRPC NBI")
rootCmd.Flags().StringVar(&csbiOrchestrstor, "csbi-orchestrator", "localhost:55056", "csbi orchestrator address")
}
// initConfig reads in config file and ENV variables if set.
@@ -105,9 +99,8 @@ func initConfig() {
log.Debug("Using config file:", viper.ConfigFileUsed())
}
viper.SetDefault("socket", ":"+grpcPort)
cliPnd = viper.GetString("CLI_PND")
cliSbi = viper.GetString("CLI_SBI")
viper.SetDefault("socket", ":55055")
viper.SetDefault("csbi-orchestrator", "localhost:55056")
ll := viper.GetString("GOSDN_LOG")
if ll != "" {
Loading