aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vicn/resource/central.py7
-rw-r--r--vicn/resource/icn/producer.py8
2 files changed, 12 insertions, 3 deletions
diff --git a/vicn/resource/central.py b/vicn/resource/central.py
index 4398ae5a..bf1c8f7a 100644
--- a/vicn/resource/central.py
+++ b/vicn/resource/central.py
@@ -523,11 +523,12 @@ class ICNRoutes(Resource):
def _get_prefix_origins(self):
origins = dict()
for group in self.groups:
- for producer in group.iter_by_type_str('producer'):
- node_uuid = producer.node._state.uuid
+ for node in group.iter_by_type_str('node'):
+ node_uuid = node._state.uuid
if not node_uuid in origins:
origins[node_uuid] = list()
- origins[node_uuid].extend(producer.prefixes)
+ for producer in node.producers:
+ origins[node_uuid].extend(producer.prefixes)
return origins
def _get_icn_routes(self):
diff --git a/vicn/resource/icn/producer.py b/vicn/resource/icn/producer.py
index 23434ebd..131097f2 100644
--- a/vicn/resource/icn/producer.py
+++ b/vicn/resource/icn/producer.py
@@ -19,6 +19,7 @@
from netmodel.model.type import String
from vicn.resource.icn.icn_application import ICNApplication
from vicn.core.attribute import Attribute, Multiplicity
+from vicn.resource.node import Node
class Producer(ICNApplication):
"""
@@ -27,3 +28,10 @@ class Producer(ICNApplication):
prefixes = Attribute(String, description = 'List of served prefixes',
multiplicity = Multiplicity.OneToMany)
+ #Overload to get producer list from node in CentralICN
+ node = Attribute(Node,
+ description = 'Node on which the producer is installed',
+ mandatory = True,
+ multiplicity = Multiplicity.ManyToOne,
+ reverse_name = 'producers',
+ key = True)