From 79771a4ab0369360b50b3ad0ef1b9a4c58751712 Mon Sep 17 00:00:00 2001 From: "Ch.-David Blot" Date: Thu, 3 Jul 2025 09:30:15 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20read=20api=20version=20fr?= =?UTF-8?q?om=20spec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- osc_sdk_python/outscale_gateway.py | 3 ++- tests/test_log.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osc_sdk_python/outscale_gateway.py b/osc_sdk_python/outscale_gateway.py index 1d36f97..0bd260d 100644 --- a/osc_sdk_python/outscale_gateway.py +++ b/osc_sdk_python/outscale_gateway.py @@ -69,7 +69,7 @@ def __init__(self, **kwargs): self._load_gateway_structure() self._load_errors() self.log = Logger() - self.call = Call(logger=self.log, **kwargs) + self.call = Call(logger=self.log, version=self.endpoint_api_version, **kwargs) def update_credentials(self, **kwargs): """ @@ -104,6 +104,7 @@ def _convert(self, input_file): except Exception as err: print("Problem reading {}:{}".format(input_file, str(err))) self.api_version = content["info"]["version"] + self.endpoint_api_version = content["servers"][0]["url"].split("/")[-1] for action, params in content["components"]["schemas"].items(): if action.endswith("Request"): action_name = action.split("Request")[0] diff --git a/tests/test_log.py b/tests/test_log.py index aa16b83..2f9dce7 100644 --- a/tests/test_log.py +++ b/tests/test_log.py @@ -10,14 +10,14 @@ def test_listing(self): gw.log.config(type=LOG_MEMORY, what=LOG_KEEP_ONLY_LAST_REQ) gw.ReadVms() self.assertEqual(gw.log.str(), - """uri: /api/latest/ReadVms + """uri: /api/v1/ReadVms payload: {}""" ) gw.ReadVms(Filters={'TagKeys': ['test']}) self.assertEqual(gw.log.str(), - """uri: /api/latest/ReadVms + """uri: /api/v1/ReadVms payload: { "Filters": {