Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion osc_sdk_python/outscale_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading