From c4959d198c1e6c49465b9bc01f90f1fba40e0a8e Mon Sep 17 00:00:00 2001 From: Felipe Vicens Date: Fri, 8 May 2020 10:35:56 +0200 Subject: [PATCH] Fixed osm version for pre-7.0 version Change-Id: I661d8abd8a845275f853bbea01092b547406ebf4 Signed-off-by: Felipe Vicens --- osmclient/sol005/client.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osmclient/sol005/client.py b/osmclient/sol005/client.py index 379951b..5e28797 100644 --- a/osmclient/sol005/client.py +++ b/osmclient/sol005/client.py @@ -127,8 +127,15 @@ class Client(object): def get_version(self): _, resp = self._http_client.get2_cmd(endpoint="/version", skip_query_admin=True) - resp = json.loads(resp) - return "{} {}".format(resp.get("version"), resp.get("date")) + #print(http_code, resp) + try: + resp = json.loads(resp) + version = resp.get("version") + date = resp.get("date") + except ValueError: + version = resp.split()[2] + date = resp.split()[4] + return "{} {}".format(version, date) def set_default_params(self, **kwargs): host = kwargs.pop('host', None) -- 2.25.1