This is a pyang plugin to generate config/bgp_configs.go from openconfig yang files.
Python 2.
Clone the required resources by using Git:
$ cd $HOME
$ git clone https://github.com/osrg/gobgp
$ git clone https://github.com/osrg/public
$ git clone https://github.com/osrg/yang
$ git clone https://github.com/osrg/pyang
Generate config/bgp_configs.go from yang files:
$ export GOBGP=`pwd`
$ cd $HOME/pyang
$ source ./env.sh
$ PYTHONPATH=. ./bin/pyang \
--plugindir $GOBGP/tools/pyang_plugins \
-p $HOME/yang/standard/ietf/RFC \
-p $HOME/public/release/models \
-p $HOME/public/release/models/bgp \
-p $HOME/public/release/models/policy \
-f golang \
$HOME/public/release/models/bgp/openconfig-bgp.yang \
$HOME/public/release/models/policy/openconfig-routing-policy.yang \
$GOBGP/tools/pyang_plugins/gobgp.yang \
| gofmt > $GOBGP/internal/pkg/config/bgp_configs.go