Remove v1 version of osmclient which was used with old NBI (pre-Release FOUR)
[osm/osmclient.git] / osmclient / sol005 / client.py
index b6f12b3..70d5c13 100644 (file)
@@ -18,7 +18,6 @@
 OSM SOL005 client API
 """
 
-# from osmclient.v1 import vca
 from osmclient.sol005 import vnfd
 from osmclient.sol005 import nsd
 from osmclient.sol005 import nst
@@ -55,7 +54,6 @@ class Client(object):
         project="admin",
         **kwargs
     ):
-
         self._user = user
         self._password = password
         self._project = project
@@ -78,10 +76,7 @@ class Client(object):
         )
         self._headers["Accept"] = "application/json"
         self._headers["Content-Type"] = "application/yaml"
-        http_header = [
-            "{}: {}".format(key, val) for (key, val) in list(self._headers.items())
-        ]
-        self._http_client.set_http_header(http_header)
+        self._http_client.set_http_header(self._headers)
 
         self.vnfd = vnfd.Vnfd(self._http_client, client=self)
         self.nsd = nsd.Nsd(self._http_client, client=self)
@@ -131,16 +126,15 @@ class Client(object):
 
             token = json.loads(resp) if resp else None
             if token.get("message") == "change_password" and not pwd_change:
-                raise ClientException("Password Expired. Please update the password using change_password option")
+                raise ClientException(
+                    "Password Expired. Please update the password using change_password option"
+                )
             self._token = token["id"]
 
             if self._token is not None:
                 self._headers["Authorization"] = "Bearer {}".format(self._token)
-                http_header = [
-                    "{}: {}".format(key, val)
-                    for (key, val) in list(self._headers.items())
-                ]
-                self._http_client.set_http_header(http_header)
+                self._http_client.set_http_header(self._headers)
+            return token
 
     def get_version(self):
         _, resp = self._http_client.get2_cmd(endpoint="/version", skip_query_admin=True)