X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fvnf.py;h=b7ac856e6620fc9581f8036ce9062332840f2d5b;hb=e7c35ebebd990277d29bfa54eff31c0cccaed78d;hp=9875d39f71cc0a0432dc8c95495c5f46d0eb381f;hpb=e84376b0a90115f6c7ed342f92f1e6e414e9faee;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/vnf.py b/osmclient/sol005/vnf.py index 9875d39..b7ac856 100644 --- a/osmclient/sol005/vnf.py +++ b/osmclient/sol005/vnf.py @@ -36,6 +36,7 @@ class Vnf(object): def list(self, ns=None, filter=None): """Returns a list of VNF instances """ + self._client.get_token() filter_string = '' if filter: filter_string = '?{}'.format(filter) @@ -46,7 +47,7 @@ class Vnf(object): else: filter_string = '?nsr-id-ref={}'.format(ns_instance['_id']) resp = self._http.get_cmd('{}{}'.format(self._apiBase,filter_string)) - #print 'RESP: {}'.format(resp) + #print('RESP: {}'.format(resp)) if resp: return resp return list() @@ -54,6 +55,7 @@ class Vnf(object): def get(self, name): """Returns a VNF instance based on name or id """ + self._client.get_token() if utils.validate_uuid4(name): for vnf in self.list(): if name == vnf['_id']: @@ -65,6 +67,7 @@ class Vnf(object): raise NotFound("vnf {} not found".format(name)) def get_individual(self, name): + self._client.get_token() vnf_id = name if not utils.validate_uuid4(name): for vnf in self.list(): @@ -72,7 +75,7 @@ class Vnf(object): vnf_id = vnf['_id'] break resp = self._http.get_cmd('{}/{}'.format(self._apiBase, vnf_id)) - #print 'RESP: {}'.format(resp) + #print('RESP: {}'.format(resp)) if resp: return resp raise NotFound("vnf {} not found".format(name))