Closed ksator closed 1 year ago
Tried a quick run to generate the gnmi config json, but keep getting the following typeerror for reraise() function call. pretty much having followed the exact guidance, Any idea how to fix and proceed? it's for preparing a quick gnmi demo.
"TypeError: reraise() missing 2 required positional arguments: 'tp' and 'value'"
xji@vmxji:~/devops/yang/consolidated$ pip3 list | grep pyang pyang 2.5.3 pyangbind 0.8.1 xji@vmxji:~/devops/yang/consolidated$ python3 -V Python 3.10.6 ... File "/home/xji/.local/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py", line 1160, in YANGDynClass return YANGBaseClass(*args, **kwargs) File "/home/xji/.local/lib/python3.10/site-packages/pyangbind/lib/yangtypes.py", line 1037, in init six.reraise() TypeError: reraise() missing 2 required positional arguments: 'tp' and 'value'
rm -Rf yang
mkdir -p yang/consolidated
git clone https://github.com/openconfig/public.git yang/openconfig
git clone https://github.com/aristanetworks/yang.git yang/arista
cp yang/openconfig/release/models/.yang yang/consolidated/
cp -R yang/openconfig/release/models//.yang yang/consolidated/
cp yang/openconfig/third_party/ietf/.yang yang/consolidated/
for i in find yang/arista/EOS-4.28.2F/ -name 'arista*.yang'
; do cp $i yang/consolidated; done
export PYBINDPLUGIN=/usr/bin/env python -c \ 'import pyangbind; import os; print ("{}/plugin".format(os.path.dirname(pyangbind.__file__)))'
echo $PYBINDPLUGIN
cd yang/consolidated pyang --plugindir $PYBINDPLUGIN -f pybind -o ./ni.py openconfig-network-instance.yang
This issue has been marked stale given 180 days of inactivity. It will be automatically closed in 14 days if there are no updates.
This issue has been closed due to prolonged inactivity.
we need to update: https://github.com/aristanetworks/openmgmt/blob/main/src/pyangbind/pyangbind_demo.py https://github.com/aristanetworks/openmgmt/tree/main/docs/examples/pyangbind
Here's an example, inspired by https://github.com/arista-netdevops-community/openconfig-peering/blob/main/oc-peering.py#L126