From: Vratko Polak Date: Mon, 22 Jan 2024 13:56:02 +0000 (+0100) Subject: papi: support old style of providing apidir X-Git-Tag: v24.06-rc0~3 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=1effb29aa2c3e9179192dd3919c8d849fcb08dae;p=vpp.git 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 --- 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: