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

Throw exception when not use swsssdk in UT. #126

Merged
merged 14 commits into from
Oct 9, 2022

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Sep 9, 2022

Why I did it

swsssdk been deprecated after 202205 branch, all use should switch to sonic-swss-common.

How I did it

Throw exception when load swsssdk for none UT usage.

How to verify it

Pass all UT.

Which release branch to backport (provide reason below if selected)

Description for the changelog

Throw exception when load swsssdk for none UT usage.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@liuh-80
Copy link
Contributor Author

liuh-80 commented Sep 9, 2022

E2E test will validate with this PR: sonic-net/sonic-buildimage#12036

@liuh-80
Copy link
Contributor Author

liuh-80 commented Sep 27, 2022

This PR depends on another PR merge first: sonic-net/sonic-buildimage#12185

@liuh-80
Copy link
Contributor Author

liuh-80 commented Sep 27, 2022

The code change in this PR validated with this PR: sonic-net/sonic-buildimage#12036

@liuh-80 liuh-80 marked this pull request as ready for review September 28, 2022 03:09
@liuh-80 liuh-80 requested a review from qiluo-msft September 28, 2022 03:10
src/swsssdk/__init__.py Outdated Show resolved Hide resolved
@@ -26,12 +26,6 @@
extras_require={
'high_perf': high_performance_deps
},
entry_points={
'console_scripts': [
Copy link
Contributor

Choose a reason for hiding this comment

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

console_scripts

Let's define a new var console_scripts in order to keep some history trace, and entry_points={}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for misleading. console_scripts variable should be defined at file global scope. It is not a parameter for setup function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -34,3 +34,11 @@ def test__dbConfig(self):
for namespace in list(dbConfig.get_ns_list()):
self.assertEqual(dbConfig.get_dbid('PFC_WD_DB', namespace), 5)
self.assertEqual(dbConfig.get_dbid('APPL_DB', namespace), 0)

def test_BlockUseSwsssdk():
# change
Copy link
Contributor

@qiluo-msft qiluo-msft Sep 29, 2022

Choose a reason for hiding this comment

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

change

You want to remove the whole comment line? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@liuh-80 liuh-80 merged commit e30a1e1 into sonic-net:master Oct 9, 2022
@liuh-80 liuh-80 deleted the dev/liuh/disable-sdk branch October 9, 2022 01:05
EdenGri pushed a commit to EdenGri/sonic-py-swsssdk that referenced this pull request Oct 30, 2022
#### Why I did it
swsssdk been deprecated after 202205 branch, all use should switch to sonic-swss-common.

#### How I did it
Throw exception when load swsssdk for none UT usage.

#### How to verify it
Pass all UT.

#### Which release branch to backport (provide reason below if selected)

#### Description for the changelog
Throw exception when load swsssdk for none UT usage.

#### Link to config_db schema for YANG module changes

#### A picture of a cute animal (not mandatory but encouraged)
EdenGri pushed a commit to EdenGri/sonic-py-swsssdk that referenced this pull request Oct 30, 2022
#### Why I did it
swsssdk been deprecated after 202205 branch, all use should switch to sonic-swss-common.

#### How I did it
Throw exception when load swsssdk for none UT usage.

#### How to verify it
Pass all UT.

#### Which release branch to backport (provide reason below if selected)

#### Description for the changelog
Throw exception when load swsssdk for none UT usage.

#### Link to config_db schema for YANG module changes

#### A picture of a cute animal (not mandatory but encouraged)
EdenGri pushed a commit to EdenGri/sonic-py-swsssdk that referenced this pull request Oct 31, 2022
dprital added a commit to dprital/sonic-buildimage that referenced this pull request Oct 31, 2022
Update sonic-py-swsssdk submodule pointer to include the following:
* e30a1e1 Throw exception when not use swsssdk in UT. ([sonic-net#126](sonic-net/sonic-py-swsssdk#126))

Signed-off-by: dprital <drorp@nvidia.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