Skip to content

Fix Cisco-8000 platform file writing#7669

Merged
kevinskwang merged 1 commit intosonic-net:masterfrom
rbpittman:fix_platform_writer
Mar 8, 2023
Merged

Fix Cisco-8000 platform file writing#7669
kevinskwang merged 1 commit intosonic-net:masterfrom
rbpittman:fix_platform_writer

Conversation

@rbpittman
Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

Fix Cisco-8000 platform file writing.

How did you do it?

Platform file variable location moved into a deeper structure, added relevant accessor to change these variables.

How did you verify/test it?

Reproduced breakage on 202012 branch for LossyQueueVoq test case, verified this change passes the test.
Uplifted 202012 edited code to master to file this PR since master/202205 also needs the change.

Any platform specific information?

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

Documentation

@wangxin
Copy link
Copy Markdown
Collaborator

wangxin commented Mar 7, 2023

The pre-commit check detected issues in the files touched by this pull request.
The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/common/cisco_data.py:59:14: E231 missing whitespace after ','

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>

@rbpittman rbpittman mentioned this pull request Mar 7, 2023
6 tasks
original_values = {}
markings_dict = {}
# Getting markings from first device.
device = json_contents['devices'][0]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it guaranteed that json_contents['devices'] will have only one entry ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In non-T2 asics, it should have only 1.
If it has more than one, they should all be in sync, and it's only necessary to return the first.

@kevinskwang kevinskwang merged commit 6b63db1 into sonic-net:master Mar 8, 2023
wangxin pushed a commit that referenced this pull request Mar 9, 2023
wangxin pushed a commit that referenced this pull request Mar 9, 2023
@rbpittman rbpittman deleted the fix_platform_writer branch October 18, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants