forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
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 sysfs reading that gets garbage end of line using strip #11
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dbarashinvd
force-pushed
the
dbarashi_indep_mode_fix_sysfs_read
branch
from
January 3, 2024 17:59
bbc5f8b
to
7022ccd
Compare
keboliu
reviewed
Jan 4, 2024
@@ -279,14 +279,12 @@ def run(self): | |||
module_fd_path = module_obj.module_power_good_fd_path | |||
self.fds_events_count_dict[module_obj.port_num][fd_name] += 1 | |||
try: | |||
val = module_fd.read() | |||
val = module_fd.read().strip() | |||
module_fd.seek(0) | |||
logger.log_info("dynamic detection got module_obj {} with port {} from fd number {} path {} val {} count {}" | |||
.format(module_obj, module_obj.port_num, fd, module_fd_path | |||
, val, self.fds_events_count_dict[module_obj.port_num])) | |||
# workaround for garbage received after the 0 or 1 value of sysfs i.e. 0#012 or 1#012 |
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.
this line should also be removed?
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.
thanks. done.
dbarashinvd
force-pushed
the
dbarashi_indep_mode_fix_sysfs_read
branch
from
January 4, 2024 09:38
7022ccd
to
660d36a
Compare
keboliu
approved these changes
Jan 9, 2024
update file header to 2024
dbarashinvd
force-pushed
the
dbarashi_indep_mode_fix_sysfs_read
branch
from
January 16, 2024 17:13
660d36a
to
667ddbc
Compare
dbarashinvd
pushed a commit
that referenced
this pull request
Mar 14, 2024
…buf (sonic-net#17521) * [submodule]: Update submodule sonic-swss/sonic-dash-api/protobuf (sonic-net#17413) 1. Protobuf 3.21 has been released in the Debian bookworm 2. Update submodule sonic-swss and sonic-dash-api because they include related updates. - Microsoft ADO **(number only)**: 1. In the protobuf.mk, If it isn't bullseye, ignore to compile the protobuf package 2. Move sonic-swss commits: ``` fd852084 (HEAD, origin/master, origin/HEAD) [dashrouteorch]: Rename dash route namespace (sonic-net#2966) ``` 3. Move sonic-dash-api and move build chain to its submodule ``` d4448c7 (HEAD, origin/master, origin/HEAD, master) [azp]: Add multi-platform artifacts (#11) 8a5e5cc [debian]: Add debian package (#10) d96163a [misc]: Add dash utils and its tests (#9) ``` Signed-off-by: Ze Gan <ganze718@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I did it
when reading sysfs fd upon python poller events, there's end of line garbage like "# 012" (without space between the 2 parts) trailing the real value of 1 or 0
Work item tracking
How I did it
using python strip() to remove end of line
How to verify it
run on a switch and disconnect or reconnect a port to create a poller event
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)