Skip to content

[rfc2737] Fix issue: expect redis pubsub data to be str type instead of bytes type #196

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

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

Junchao-Mellanox
Copy link
Collaborator

- What I did

Change redis pubsub expect data type from bytes to str. There was a snmpagent framework change which transfer redis pubsub data from bytes to str, after that change, there is no need for non-framework code to do this transfer. So now we need handle str data directly.

- How I did it

Change data expectation from bytes to str

- How to verify it

Run regression and manual test

- Description for the changelog

@liat-grozovik
Copy link
Collaborator

@qiluo-msft can you please take a look?

@sonic-net sonic-net deleted a comment from svc-acs Feb 16, 2021
@@ -675,7 +675,7 @@ def _update_per_namespace_data(self, pubsub):

db_entry = msg["channel"].split(":")[-1]
data = msg['data'] # event data
if not isinstance(data, bytes):
if not isinstance(data, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

str [](start = 36, length = 3)

This seems a valid fix. Wondering how it worked before? I think it hit a type runtime error below "set" in data ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it was b"set" before.

@liat-grozovik
Copy link
Collaborator

@qiluo-msft can we merge and set label to 202012

@qiluo-msft qiluo-msft merged commit 183162f into sonic-net:master Feb 22, 2021
qiluo-msft pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Feb 23, 2021
183162f Fix issue: expect redis pubsub data to be str type instead of bytes type (#196)

#### Why I did it

Update submodule pointer for snmpagent to include PR sonic-net/sonic-snmpagent#196 

#### How I did it

Update submodule pointer for snmpagent

#### How to verify it

Run build
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
183162f Fix issue: expect redis pubsub data to be str type instead of bytes type (sonic-net#196)

#### Why I did it

Update submodule pointer for snmpagent to include PR sonic-net/sonic-snmpagent#196 

#### How I did it

Update submodule pointer for snmpagent

#### How to verify it

Run build
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.

3 participants