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 yang model checking failed for MGMT_PORT #2601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kuanyu99
Copy link
Contributor

@kuanyu99 kuanyu99 commented Jan 17, 2023

What I did

Fix the configuration validation failure after I set the IP on the eth0 with the command "sudo config interface ip add eth0"

admin@sonic:~$ sudo config auto-techsupport global available-mem-threshold 20
libyang[0]: Leafref "/sonic-mgmt_port:sonic-mgmt_port/sonic-mgmt_port:MGMT_PORT/sonic-mgmt_port:MGMT_PORT_LIST/sonic-mgmt_port:name" of value "eth0" points to a non-existing leaf. (path: /sonic-mgmt_interface:sonic-mgmt_interface/MGMT_INTERFACE/MGMT_INTERFACE_LIST[name='eth0'][ip_prefix='192.168.3.30/16']/name)
libyang[0]: Leafref "/sonic-mgmt_port:sonic-mgmt_port/sonic-mgmt_port:MGMT_PORT/sonic-mgmt_port:MGMT_PORT_LIST/sonic-mgmt_port:name" of value "eth0" points to a non-existing leaf. (path: /sonic-mgmt_interface:sonic-mgmt_interface/MGMT_INTERFACE/MGMT_INTERFACE_LIST[name='eth0'][ip_prefix='192.168.3.30/16']/name)
sonic_yang(3):Data Loading Failed:Leafref "/sonic-mgmt_port:sonic-mgmt_port/sonic-mgmt_port:MGMT_PORT/sonic-mgmt_port:MGMT_PORT_LIST/sonic-mgmt_port:name" of value "eth0" points to a non-existing leaf.
Data Loading Failed
Leafref "/sonic-mgmt_port:sonic-mgmt_port/sonic-mgmt_port:MGMT_PORT/sonic-mgmt_port:MGMT_PORT_LIST/sonic-mgmt_port:name" of value "eth0" points to a non-existing leaf.
Error: Failed to validate configuration: ConfigMgmt Class creation failed
Aborted! 

How I did it

Add the MGMT_PORT config entry when I execute the CLI command to set the IP on the eth0 port.

How to verify it

  1. Run a whole new sonic building procedure
  2. Test the "config auto-techsupport" command after I setting the IP on the eth0
  3. No configuration validation failure

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

* After I execute the CLI command to set the eth0 with the management IP,
  the configuration validation will always fail due to lacking of the MGMT_PORT

* This patch will add the MGMT_PORT entry when setting the eth0 MGMT_INTERFACE entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant