Skip to content

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

Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom
Junchao-Mellanox:fix-bytes
Feb 22, 2021
Merged

[rfc2737] Fix issue: expect redis pubsub data to be str type instead of bytes type#196
qiluo-msft merged 1 commit intosonic-net:masterfrom
Junchao-Mellanox:fix-bytes

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
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
ssithaia-ebay pushed a commit to ssithaia-ebay/sonic-snmpagent that referenced this pull request May 23, 2025
…ype (sonic-net#196)

**- 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
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