]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
various fices
authorMaria Matejka <mq@ucw.cz>
Thu, 23 Nov 2023 08:23:46 +0000 (09:23 +0100)
committerMaria Matejka <mq@ucw.cz>
Thu, 23 Nov 2023 08:23:46 +0000 (09:23 +0100)
yang/JSON_CBOR.py
yang/cbor-json-yang
yang/json-cbor-yang
yang/show_status.yang
yang/yang-library.json

index ccbfc3513081df07f19432685653e104328883f0..fc7b8da0d45194b2ff0739d6ce7924f1f48c3bc9 100644 (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()
index a31b769e6dd298b68d88be6b47f9717f7dfb95d8..857008cd4eb93fe51e51776d5b693cb6dea5fade 100755 (executable)
@@ -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 "$@"
index 97e9546ac2d757e837180b3ed715fad1d035b85f..6f08f9c55a27cc629c5eb230e18b3e59c975971b 100755 (executable)
@@ -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 "$@"
index 2e4ea86e2bacf41324590877cd242762aae9d8d7..e89be0ed749cc09fb40a7aab97b7c8c5b1271863 100644 (file)
@@ -55,7 +55,7 @@ module show_status {
           type int32;
         }
         container wait_timer {
-          uses timer
+          uses timer;
         }
       }
     }
index 24fa2b815f3969c065d7e9526de94244d63b7c7f..0920a8597cc6533561b3ad72754f8cee59c75a27 100644 (file)
        "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"
       }
     ]
   }