summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorCarl Baldwin <carl@ecbaldwin.net>2019-07-24 09:02:18 -0600
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-08-28 09:06:20 +0900
commit8900db7551a01d3dba019445b08357ffe0cc3bed (patch)
treee8e50be5aedff0bbe7989fb25a2fd523a7607f1a /cmd
parented1aef36e72157ae981671baaa2fd54fdbeea7f2 (diff)
Switch away from channel for one-off dry run
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gobgpd/main.go13
1 files changed, 10 insertions, 3 deletions
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)
}