X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Fdata_utils%2Fnsr.py;h=006713ca93d529c63fde76f766d35554d06da087;hb=5f75f10f2308aa6a8cf36cfdeeb20dc95316c5ce;hp=f62b0b40262fdf1b20e64cfa9b832c955675815d;hpb=5697b8b03a3acd17827ce536cb8aff15df8776ad;p=osm%2FLCM.git diff --git a/osm_lcm/data_utils/nsr.py b/osm_lcm/data_utils/nsr.py index f62b0b4..006713c 100644 --- a/osm_lcm/data_utils/nsr.py +++ b/osm_lcm/data_utils/nsr.py @@ -22,6 +22,20 @@ # contact: fbravo@whitestack.com ## +from osm_lcm.lcm_utils import get_iterable + def get_vlds(nsr): return nsr.get("vld", ()) + + +def get_deployed_kdu(nsr_deployed, kdu_name, member_vnf_index): + deployed_kdu = None + index = None + for index, deployed_kdu in enumerate(get_iterable(nsr_deployed, "K8s")): + if ( + kdu_name == deployed_kdu["kdu-name"] + and deployed_kdu["member-vnf-index"] == member_vnf_index + ): + break + return deployed_kdu, index