From: Felipe Vicens Date: Fri, 8 May 2020 08:35:56 +0000 (+0200) Subject: Fixed osm version for pre-7.0 version X-Git-Tag: v7.1.0rc1^2~1^2~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F8889%2F1;p=osm%2Fosmclient.git Fixed osm version for pre-7.0 version Change-Id: I661d8abd8a845275f853bbea01092b547406ebf4 Signed-off-by: Felipe Vicens --- 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)