Change to the proto build script broken by the OMCI mib
protos. Also changes to coding style in the config.go
file to be more consistent with common practice.
Change-Id: Ia0ae059c7893369795b10c3c57b4961df8a15fa5
diff --git a/afrouter/afrouter/config.go b/afrouter/afrouter/config.go
index 761be2e..c495376 100644
--- a/afrouter/afrouter/config.go
+++ b/afrouter/afrouter/config.go
@@ -37,7 +37,7 @@
config.GrpcLog = cmdParse.Bool("grpclog", false, "Enable GRPC logging")
err := cmdParse.Parse(os.Args[1:]);
- if(err != nil) {
+ if err != nil {
//return err
return nil, errors.New("Error parsing the command line");
}
@@ -192,14 +192,14 @@
// Resolve router references for the servers
log.Debug("Resolving references in the config file");
- for k,_ := range(conf.Servers) {
+ for k,_ := range conf.Servers {
//s.routers =make(map[string]*RouterConfig)
conf.Servers[k].routers = make(map[string]*RouterConfig)
- for _,rPkg := range(conf.Servers[k].Routers) {
+ for _,rPkg := range conf.Servers[k].Routers {
var found bool = false
// Locate the router "r" in the top lever Routers array
log.Debugf("Resolving router reference to router '%s' from server '%s'",rPkg.Router, conf.Servers[k].Name)
- for rk, _ := range(conf.Routers) {
+ for rk, _ := range conf.Routers {
if conf.Routers[rk].Name == rPkg.Router && !found {
log.Debugf("Reference to router '%s' found for package '%s'", rPkg.Router, rPkg.Package)
conf.Servers[k].routers[rPkg.Package] = &conf.Routers[rk]
@@ -224,11 +224,11 @@
}
// Resolve backend references for the routers
- for rk,rv := range(conf.Routers) {
- for rtk,rtv := range(rv.Routes) {
+ for rk,rv := range conf.Routers {
+ for rtk,rtv := range rv.Routes {
var found bool = false
log.Debugf("Resolving backend reference to %s from router %s",rtv.BackendCluster, rv.Name)
- for bek,bev := range(conf.BackendClusters) {
+ for bek,bev := range conf.BackendClusters {
log.Debugf("Checking cluster %s", conf.BackendClusters[bek].Name)
if rtv.BackendCluster == bev.Name && !found {
conf.Routers[rk].Routes[rtk].backendCluster = &conf.BackendClusters[bek]
diff --git a/protos/scripts/build_protos.sh b/protos/scripts/build_protos.sh
index a65764c..7a9dd76 100755
--- a/protos/scripts/build_protos.sh
+++ b/protos/scripts/build_protos.sh
@@ -29,7 +29,6 @@
$SRC_DIR/events.proto \
$SRC_DIR/health.proto \
$SRC_DIR/logical_device.proto \
- $SRC_DIR/omci_mib_db.proto \
$SRC_DIR/ponsim.proto \
$SRC_DIR/voltha.proto"
@@ -44,6 +43,7 @@
export OF_PB="$SRC_DIR/openflow_13.proto"
export OMCI_PB="$SRC_DIR/omci*.proto"
export AFROUTER_PB="$SRC_DIR/afrouter.proto"
+export OMCI_PB="$SRC_DIR/omci_mib_db.proto"
export PB_VARS="\
VOLTHA_PB \
@@ -53,7 +53,8 @@
IETF_PB \
OF_PB \
OMCI_PB \
- AFROUTER_PB"
+ AFROUTER_PB \
+ OMCI_PB"
export OTHER_INCLUDES="/usr/local/include/googleapis"
export PROTO_DESC_FILE="${SRC_DIR}/voltha.pb"