sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

[dhcp_server][ansible] Enable dhcp_server in mx when deploy-mg

Open yaqiangz opened this issue 1 year ago • 1 comments

Description of PR

Summary: Fixes # (issue)

Type of change

  • [ ] Bug fix
  • [ ] Testbed and Framework(new/improvement)
  • [ ] Test case(new/improvement)

Back port request

  • [ ] 202012
  • [ ] 202205
  • [ ] 202305
  • [x] 202311
  • [x] 202405

Approach

What is the motivation for this PR?

Enable dhcp_server for mx when deploy-mg

How did you do it?

  1. Use config load_minigraph --override_config to load minigraph.
  2. Generate mx specified golden_config_db

How did you verify/test it?

  1. Deploy-mg in mx device, configuration is as expected.
  2. Deploy-mg in non-mx device, configuration is as espected.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

yaqiangz avatar Jul 09 '24 09:07 yaqiangz

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing ansible/golden_config_db/dhcp_server_mx.json

check yaml...............................................................Passed
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

ansible/library/generate_golden_config_db.py:18:121: E501 line too long (125 > 120 characters)
ansible/library/generate_golden_config_db.py:67:121: E501 line too long (161 > 120 characters)
ansible/library/generate_golden_config_db.py:68:121: E501 line too long (123 > 120 characters)
ansible/library/generate_golden_config_db.py:70:121: E501 line too long (122 > 120 characters)
...
[truncated extra lines, please run pre-commit locally to view full check results]

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

mssonicbld avatar Jul 09 '24 09:07 mssonicbld

Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-mgmt/pull/13703

mssonicbld avatar Jul 17 '24 17:07 mssonicbld

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-mgmt/pull/13704

mssonicbld avatar Jul 17 '24 17:07 mssonicbld