-
Notifications
You must be signed in to change notification settings - Fork 2
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
Remove sonic ports defaults #323
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is setting fec, mtu, and speed still tested?
{% set port = sonic_ports_dict[name] %} | ||
{% if (port is defined and port.speed is defined) or running_cfg.speed is defined %} | ||
speed: "{{ (port | default({})).speed | default(running_cfg.speed) }}" | ||
{% endif %} | ||
{% if (port is defined and port.mtu is defined) or running_cfg.mtu is defined %} | ||
mtu: "{{ (port | default({})).mtu | default(running_cfg.mtu) }}" | ||
{% endif %} | ||
{% if (port is defined and port.fec is defined) or running_cfg.fec is defined %} | ||
fec: "{{ (port | default({})).fec | default(running_cfg.fec) }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try?
{% set port = sonic_ports_dict[name] %} | |
{% if (port is defined and port.speed is defined) or running_cfg.speed is defined %} | |
speed: "{{ (port | default({})).speed | default(running_cfg.speed) }}" | |
{% endif %} | |
{% if (port is defined and port.mtu is defined) or running_cfg.mtu is defined %} | |
mtu: "{{ (port | default({})).mtu | default(running_cfg.mtu) }}" | |
{% endif %} | |
{% if (port is defined and port.fec is defined) or running_cfg.fec is defined %} | |
fec: "{{ (port | default({})).fec | default(running_cfg.fec) }}" | |
{% set port = sonic_ports_dict.get(name, {}) %} | |
{% if port.speed is defined or running_cfg.speed is defined %} | |
speed: "{{ port.speed | default(running_cfg.speed) }}" | |
{% endif %} | |
{% if port.mtu is defined or running_cfg.mtu is defined %} | |
mtu: "{{ port.mtu | default(running_cfg.mtu) }}" | |
{% endif %} | |
{% if port.fec is defined or running_cfg.fec is defined %} | |
fec: "{{ port.fec | default(running_cfg.fec) }}" |
@@ -107,14 +107,16 @@ PORT: | |||
{% if 'parent_port' in running_cfg %} | |||
parent_port: {{ running_cfg.parent_port }} | |||
{% endif %} | |||
{% if sonic_ports_dict[name] is defined %} | |||
{% set port = sonic_ports_dict[name] %} | |||
admin_status: up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why always setting admin_status to up? Why not similar to fec, mtu, and speed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could introduce another variable for the admin_status, but that would possibly involve a lot of changes to the existing deployments, right?
This reverts commit aa3080b.
Closing in favor of #324. |
Additional Description
Currently, if the
sonic_ports
variable is defined the sonic role will require default values for fec, mtu and speed to be set. A more reasonable behavior, in my opinion, is to leave all settings of the running configuration in place, if no value was provided.Breaking Change