Fixed osm version for pre-7.0 version 89/8889/1
authorFelipe Vicens <felipe.vicens@atos.net>
Fri, 8 May 2020 08:35:56 +0000 (10:35 +0200)
committerFelipe Vicens <felipe.vicens@atos.net>
Fri, 8 May 2020 08:35:56 +0000 (10:35 +0200)
Change-Id: I661d8abd8a845275f853bbea01092b547406ebf4
Signed-off-by: Felipe Vicens <felipe.vicens@atos.net>
osmclient/sol005/client.py

index 379951b..5e28797 100644 (file)
@@ -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)