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 sysfs reading that gets garbage end of line using strip #11

Closed
wants to merge 2 commits into from

Conversation

dbarashinvd
Copy link
Owner

@dbarashinvd dbarashinvd commented Jan 3, 2024

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
  • Microsoft ADO (number only):

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

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)

@dbarashinvd dbarashinvd force-pushed the dbarashi_indep_mode_fix_sysfs_read branch from bbc5f8b to 7022ccd Compare January 3, 2024 17:59
@@ -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
Copy link

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?

Copy link
Owner Author

Choose a reason for hiding this comment

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

thanks. done.

@dbarashinvd dbarashinvd force-pushed the dbarashi_indep_mode_fix_sysfs_read branch from 7022ccd to 660d36a Compare January 4, 2024 09:38
@dbarashinvd dbarashinvd force-pushed the dbarashi_indep_mode_fix_sysfs_read branch from 660d36a to 667ddbc Compare January 16, 2024 17:13
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants