Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix add-topo failure when deploying topology with empty VM list. #12932

Merged
merged 2 commits into from
May 23, 2024
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
2 changes: 1 addition & 1 deletion ansible/roles/vm_set/library/vm_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def init(self, vm_set_name, vm_base, duts_fp_ports, duts_name, ptf_exists=True,
self.pid = None

self.VMs = {}
if 'VMs' in self.topo:
if 'VMs' in self.topo and len(self.topo['VMs']) > 0:
self.vm_base = vm_base
if vm_base in self.vm_names:
self.vm_base_index = self.vm_names.index(vm_base)
Expand Down
6 changes: 4 additions & 2 deletions ansible/templates/minigraph_dpg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@
<Type>EverflowV6</Type>
</AclInterface>
{% if enable_data_plane_acl|default('true')|bool and vm_topo_config['topo_type'] != 'wan' %}
<AclInterface>
<AttachTo>
{%- set acl_intfs = [] -%}
{%- for index in range(vms_number) %}
{% if 'port-channel' in vm_topo_config['vm'][vms[index]]['ip_intf'][dut_index|int]|lower %}
Expand All @@ -297,13 +295,17 @@
{% endif %}
{% endif %}
{% endfor -%}
{%- if acl_intfs | length > 0 -%}
<AclInterface>
<AttachTo>
{{- acl_intfs|join(';') -}}
</AttachTo>
<InAcl>DataAcl</InAcl>
<Type>DataPlane</Type>
</AclInterface>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
</AclInterfaces>
<DownstreamSummaries/>
Expand Down
Loading