Revert "Revert "Remove v1 version of osmclient which was used with old NBI (pre-Relea...
[osm/osmclient.git] / osmclient / scripts / osm.py
index e5be118..74bb84b 100755 (executable)
@@ -41,9 +41,8 @@ from osmclient.cli_commands import (
     wim,
 )
 import yaml
-import pycurl
-import os
 import logging
+from requests import RequestException
 
 
 @click.group(
@@ -115,8 +114,7 @@ def cli_osm(ctx, **kwargs):
         exit(1)
     # Remove None values
     kwargs = {k: v for k, v in kwargs.items() if v is not None}
-    sol005 = os.getenv("OSM_SOL005", True)
-    ctx.obj = client.Client(host=hostname, sol005=sol005, **kwargs)
+    ctx.obj = client.Client(version=1, host=hostname, **kwargs)
     logger = logging.getLogger("osmclient")
 
 
@@ -292,7 +290,7 @@ def cli():
 
         cli_osm()
         exit(0)
-    except pycurl.error as exc:
+    except RequestException as exc:
         print(exc)
         print(
             'Maybe "--hostname" option or OSM_HOSTNAME environment variable needs to be specified'