Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions netsim/augment/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ def check_group_data_structure(

list_of_modules = modules.list_of_modules(topology)

# Allow provider- and tool- specific node attributes
extra = get_object_attributes(['providers','tools'],topology)

for grp,gdata in parent.groups.items():
if grp.startswith('_'): # Skip stuff starting with underscore
continue # ... could be system settings
Expand Down Expand Up @@ -182,7 +179,8 @@ def validate_group_data(
if 'groups' not in parent:
return

extra = get_object_attributes(['providers','tools'],topology)
# Allow provider-, tool-, and output- specific node attributes
extra = get_object_attributes(topology.defaults.attributes.node_extra_ns,topology)

for grp,gdata in parent.groups.items():
if grp.startswith('_'): # Skip stuff starting with underscore
Expand Down
4 changes: 2 additions & 2 deletions netsim/augment/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def create_node_dict(nodes: Box) -> Box:
Validate node attributes
"""
def validate(topology: Box) -> None:
# Allow provider- and tool- specific node attributes
extra = get_object_attributes(['providers','tools','outputs'],topology)
# Allow provider-, tool- and output- specific node attributes
extra = get_object_attributes(topology.defaults.attributes.node_extra_ns,topology)
for n_name,n_data in topology.nodes.items():
must_be_id(
parent=None,
Expand Down
2 changes: 2 additions & 0 deletions netsim/defaults/attributes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ interface: # Interface (node-to-link attachment) attributes
ifindex: int
ifname: str

node_extra_ns: [ providers, tools, outputs ]

node:
name: str # Validity of node name is checked in the nodes module
interfaces: list
Expand Down