sonic-mgmt
sonic-mgmt copied to clipboard
[dhcp_server][ansible] Enable dhcp_server in mx when deploy-mg
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?
- Use
config load_minigraph --override_configto load minigraph. - Generate mx specified golden_config_db
How did you verify/test it?
- Deploy-mg in mx device, configuration is as expected.
- 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
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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-mgmt/pull/13703
Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-mgmt/pull/13704