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

[device/dell] Get Server ports from vlan config #1386

Merged
merged 1 commit into from
Feb 15, 2018
Merged
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 @@ -35,7 +35,25 @@
{%- if cable_len -%}
{{ cable_len.0 }}
{%- else -%}
{{ default_cable }}
{%- if switch_role == 'ToRRouter' -%}
{%- for local_port in VLAN_MEMBER -%}
{%- set vlan_port = local_port.split("|") -%}
{%- if vlan_port[1] == port_name -%}
{%- set roles3 = switch_role + '_' + 'server' -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should check neighbor role first, acting accordingly, if the neighbor role is missing, then default to use vlan member v.s. non-vlan member, assuming non-vlan members are up links.

Can you elaborate why the vlan member were tested first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yxieca As I explained to you the if check earlier takes care of the neighbor role and based on the neighbor role the cable length is taken. For the server side ports if the neighbor role is missing then we come to the else part where we check for the vlan members for those ports and get the correct cable length.

{%- set roles3 = roles3 | lower -%}
{%- if roles3 in ports2cable -%}
{%- if cable_len.append(ports2cable[roles3]) -%}{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if cable_len -%}
{{cable_len.0}}
{%- else -%}
{{ default_cable }}
{%- endif -%}
{%- else -%}
{{ default_cable }}
{%- endif -%}
{%- endif -%}
{% endmacro %}

Expand Down