From 1effb29aa2c3e9179192dd3919c8d849fcb08dae Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Mon, 22 Jan 2024 14:56:02 +0100 Subject: papi: support old style of providing apidir 77caeb1b193404e76beb27a1aa81321e8eb1cf1f has changed the behavior in an incompatible way, breaking users (including CSIT). The new behavior is more pythonic, but the old behavior has to be supported at least one release after publicly deprecating it. Type: fix Change-Id: I9dfdd2229065010216e49db80b14b856c545965c Signed-off-by: Vratko Polak --- src/vpp-api/python/vpp_papi/vpp_papi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vpp-api/python/vpp_papi/vpp_papi.py b/src/vpp-api/python/vpp_papi/vpp_papi.py index 5c089647e59..5a9e0a70c64 100644 --- a/src/vpp-api/python/vpp_papi/vpp_papi.py +++ b/src/vpp-api/python/vpp_papi/vpp_papi.py @@ -473,9 +473,12 @@ class VPPApiClient: self._apifiles = apifiles self.stats = {} + if self.apidir is None and hasattr(self.__class__, "apidir"): + # Keep supporting the old style of providing apidir. + self.apidir = self.__class__.apidir try: self.apifiles, self.messages, self.services = VPPApiJSONFiles.load_api( - apifiles, apidir + apifiles, self.apidir ) except VPPRuntimeError as e: if testmode: -- cgit 1.2.3-korg