From: Maria Matejka Date: Thu, 23 Nov 2023 08:23:46 +0000 (+0100) Subject: various fices X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb14f5769297d97cf772df2951d03f0ec162a53;p=thirdparty%2Fbird.git various fices --- diff --git a/yang/JSON_CBOR.py b/yang/JSON_CBOR.py index ccbfc3513..fc7b8da0d 100644 --- a/yang/JSON_CBOR.py +++ b/yang/JSON_CBOR.py @@ -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() diff --git a/yang/cbor-json-yang b/yang/cbor-json-yang index a31b769e6..857008cd4 100755 --- a/yang/cbor-json-yang +++ b/yang/cbor-json-yang @@ -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 "$@" diff --git a/yang/json-cbor-yang b/yang/json-cbor-yang index 97e9546ac..6f08f9c55 100755 --- a/yang/json-cbor-yang +++ b/yang/json-cbor-yang @@ -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 "$@" diff --git a/yang/show_status.yang b/yang/show_status.yang index 2e4ea86e2..e89be0ed7 100644 --- a/yang/show_status.yang +++ b/yang/show_status.yang @@ -55,7 +55,7 @@ module show_status { type int32; } container wait_timer { - uses timer + uses timer; } } } diff --git a/yang/yang-library.json b/yang/yang-library.json index 24fa2b815..0920a8597 100644 --- a/yang/yang-library.json +++ b/yang/yang-library.json @@ -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" } ] }