0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 12:18:42 +00:00

various fices

This commit is contained in:
Maria Matejka 2023-11-23 09:23:46 +01:00
parent 52921062b8
commit 1fb14f5769
5 changed files with 18 additions and 10 deletions

View File

@ -3,12 +3,18 @@ from yangson import DataModel
import cbor
import json
import os
import sys
class Message:
def __init__(self, filename, _type):
self.filename = filename
with open(self.filename, "rb") as sf:
self.raw = { "json": json, "cbor": cbor }[_type].load(sf)
cwd = os.getcwd()
os.chdir(os.path.dirname(sys.modules[__name__].__file__))
self.dm = DataModel.from_file('yang-library.json')
os.chdir(cwd)
self.data = self.dm.from_raw(self.raw)
self.data.validate()

View File

@ -1,5 +1,9 @@
YDIR=$(dirname $0)
pushd $YDIR
python3 -m venv venv
. venv/bin/activate
pip3 install yangson cbor
popd
python3 cbor-json-yang.py "$@"
python3 $YDIR/cbor-json-yang.py "$@"

View File

@ -1,5 +1,9 @@
YDIR=$(dirname $0)
pushd $YDIR
python3 -m venv venv
. venv/bin/activate
pip3 install yangson cbor
popd
python3 json-cbor-yang.py "$@"
python3 $YDIR/json-cbor-yang.py "$@"

View File

@ -55,7 +55,7 @@ module show_status {
type int32;
}
container wait_timer {
uses timer
uses timer;
}
}
}

View File

@ -19,12 +19,6 @@
"namespace": "https://bird.nic.cz/yang/v2.15/cli-debug",
"revision": "",
"conformance-type": "implement"
},
{
"name": "show_protocols_all",
"namespace": "https://bird.nic.cz/yang/v2.15/cli-debug",
"revision": "",
"conformance-type": "implement"
}
]
}