Replaces vdu-id-ref for name during VDU lookup 13/6613/1
authorBenjamin Diaz <bdiaz@whitestack.com>
Wed, 3 Oct 2018 14:38:18 +0000 (11:38 -0300)
committerBenjamin Diaz <bdiaz@whitestack.com>
Wed, 3 Oct 2018 14:38:18 +0000 (11:38 -0300)
Vdus were being looked up using the vdu-id-ref param, which
corresponds to the name used in the vnfd to define that vdu.
That was not the intended behaviour, because that param is clearly
not unique. It has been replaced with the name param, which
is unique to each vdu record.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
osm_mon/core/message_bus/common_consumer.py

index 35c2e39..95b4c0d 100755 (executable)
@@ -94,7 +94,7 @@ class CommonConsumer:
     def get_vdur(self, nsr_id, member_index, vdu_name):
         vnfr = self.get_vnfr(nsr_id, member_index)
         for vdur in vnfr['vdur']:
-            if vdur['vdu-id-ref'] == vdu_name:
+            if vdur['name'] == vdu_name:
                 return vdur
         raise ValueError('vdur not found for nsr-id %s, member_index %s and vdu_name %s', nsr_id, member_index,
                          vdu_name)