projects
/
osm
/
osmclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bug 946 - removed unnecessary check for additionalParams
[osm/osmclient.git]
/
osmclient
/
sol005
/
vnf.py
diff --git
a/osmclient/sol005/vnf.py
b/osmclient/sol005/vnf.py
index
9875d39
..
b7ac856
100644
(file)
--- 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
"""
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)
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))
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()
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
"""
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']:
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):
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():
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))
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))
if resp:
return resp
raise NotFound("vnf {} not found".format(name))