Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def prepare(self):
# management IP address from topology switches
topology_switches = model_data['vxlan']['topology']['switches']
for link in model_data['vxlan']['topology']['edge_connections']:
if any(sw['name'] == link['source_device'] for sw in topology_switches):
if "." in link['source_interface']:
self.kwargs['results']['failed'] = True
self.kwargs['results']['msg'] = "Sub interfaces not allowed to be used for edge connections"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be better done in a rule to avoid failing in the middle of runtime?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at that instead

elif any(sw['name'] == link['source_device'] for sw in topology_switches):
found_switch = next((item for item in topology_switches if item["name"] == link['source_device']))
if found_switch.get('management').get('management_ipv4_address'):
link['source_device_ip'] = found_switch['management']['management_ipv4_address']
Expand Down