projects
/
osm
/
LCM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Remove unused methods"
[osm/LCM.git]
/
osm_lcm
/
data_utils
/
nsd.py
diff --git
a/osm_lcm/data_utils/nsd.py
b/osm_lcm/data_utils/nsd.py
index
d436e1f
..
9b6fb81
100644
(file)
--- a/
osm_lcm/data_utils/nsd.py
+++ b/
osm_lcm/data_utils/nsd.py
@@
-21,6
+21,7
@@
# For those usages not covered by the Apache License, Version 2.0 please
# contact: fbravo@whitestack.com
##
# For those usages not covered by the Apache License, Version 2.0 please
# contact: fbravo@whitestack.com
##
+import ast
from osm_lcm.data_utils.list_utils import find_in_list
from osm_lcm.data_utils.list_utils import find_in_list
@@
-40,6
+41,12
@@
def get_virtual_link_profiles(nsd):
return nsd.get("df")[0].get("virtual-link-profile", ())
return nsd.get("df")[0].get("virtual-link-profile", ())
+def replace_vnf_id(nsd, old_vnf_id, new_vnf_id):
+ dict_str = str(nsd)
+ dict_str.replace(old_vnf_id, new_vnf_id)
+ return ast.literal_eval(dict_str)
+
+
def get_ns_configuration(nsd):
return nsd.get("ns-configuration", {})
def get_ns_configuration(nsd):
return nsd.get("ns-configuration", {})