From 8900db7551a01d3dba019445b08357ffe0cc3bed Mon Sep 17 00:00:00 2001 From: Carl Baldwin Date: Wed, 24 Jul 2019 09:02:18 -0600 Subject: Switch away from channel for one-off dry run --- cmd/gobgpd/main.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go index 68ea0cac..5834a406 100644 --- a/cmd/gobgpd/main.go +++ b/cmd/gobgpd/main.go @@ -123,9 +123,16 @@ func main() { } if opts.Dry { - configCh := make(chan *internal_cfg.BgpConfigSet) - go internal_cfg.ReadConfigfileServe(opts.ConfigFile, opts.ConfigType, configCh) - c := <-configCh + c, err := config.ReadConfigFile(opts.ConfigFile, opts.ConfigType) + if err != nil { + log.WithFields(log.Fields{ + "Topic": "Config", + "Error": err, + }).Fatalf("Can't read config file %s", opts.ConfigFile) + } + log.WithFields(log.Fields{ + "Topic": "Config", + }).Info("Finished reading the config file") if opts.LogLevel == "debug" { pretty.Println(c) } -- cgit v1.2.3