summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-03-16 17:10:20 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-03-17 10:47:10 +0900
commit74b6b11a029a585a6e22b8a4eb59c4d87504fa5e (patch)
tree6ae74c44edcc070b2be66c5a7aa9333440b7684f
parent5120cfc7ca03bb5742123b16d1452749d62c8db4 (diff)
config: fix SetDefaultConfigValues() not to use metadata for global config
SetDefaultConfigValues() is called in handleModConfig() which can't pass metadata to this function. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--config/default.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/config/default.go b/config/default.go
index cdd2ee54..803c8a2e 100644
--- a/config/default.go
+++ b/config/default.go
@@ -33,11 +33,11 @@ func SetDefaultConfigValues(v *viper.Viper, b *Bgp) error {
}
}
- if !v.IsSet("global.zebra.url") {
+ if b.Global.Zebra.Url == "" {
b.Global.Zebra.Url = "unix:/var/run/quagga/zserv.api"
}
- if !v.IsSet("global.afi-safis") {
+ if len(b.Global.AfiSafis) == 0 {
b.Global.AfiSafis = []AfiSafi{}
for k, _ := range AfiSafiTypeToIntMap {
b.Global.AfiSafis = append(b.Global.AfiSafis, defaultAfiSafi(k, true))
@@ -55,11 +55,11 @@ func SetDefaultConfigValues(v *viper.Viper, b *Bgp) error {
b.BmpServers[idx] = server
}
- if !v.IsSet("global.mpls-label-range.min-label") {
+ if b.Global.MplsLabelRange.MinLabel == 0 {
b.Global.MplsLabelRange.MinLabel = DEFAULT_MPLS_LABEL_MIN
}
- if !v.IsSet("global.mpls-label-range.max-label") {
+ if b.Global.MplsLabelRange.MaxLabel == 0 {
b.Global.MplsLabelRange.MaxLabel = DEFAULT_MPLS_LABEL_MAX
}