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

Replace swsssdk.ConfigDBConnector and SonicDBConfig with swsscommon implementation in sonic-py-common #7655

Closed
wants to merge 4 commits into from

Conversation

qiluo-msft
Copy link
Collaborator

Why I did it

swsssdk will be deprecated. Use swsscommon instead.

How I did it

How to verify it

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

  • 201811
  • 201911
  • 202006
  • 202012

Description for the changelog

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

qiluo-msft added a commit to sonic-net/sonic-platform-daemons that referenced this pull request May 21, 2021
…common classes (#187)

#### Description
Existing test will mix true swsscommon package with the mocked one in sonic_py_common

#### Motivation and Context
This is blocking sonic-net/sonic-buildimage#7655

#### How Has This Been Tested?
Unit test
qiluo-msft added a commit to sonic-net/sonic-platform-daemons that referenced this pull request May 24, 2021
…chassis (#188)

#### Description
Following #187 to fix the same issue with other packages

#### Motivation and Context
This is blocking sonic-net/sonic-buildimage#7655

#### How Has This Been Tested?
Unit test
SonicDBConfig.load_sonic_global_db_config()
config_db = ConfigDBConnector(namespace=namespace)
swsscommon.SonicDBConfig.load_sonic_global_db_config()
config_db = swsscommon.ConfigDBConnector(namespace=namespace)
Copy link
Collaborator Author

@qiluo-msft qiluo-msft Jun 2, 2021

Choose a reason for hiding this comment

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

swsscommon

This change will lead to some runtime error message. Still investigating...

admin@sonic:~$ sudo config load_minigraph
Warning: failed to retrieve PORT table from ConfigDB!
Traceback (most recent call last):
  File "/usr/local/bin/config", line 8, in <module>
    sys.exit(config())
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1134, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/config/main.py", line 913, in config
    SonicDBConfig.initialize()
RuntimeError: SonicDBConfig already initialized

@qiluo-msft qiluo-msft changed the title Replace swsssdk.ConfigDBConnector and SonicDBConfig with swsscommon implementation Replace swsssdk.ConfigDBConnector and SonicDBConfig with swsscommon implementation in sonic-py-common Jun 4, 2021
andywongarista pushed a commit to andywongarista/sonic-platform-daemons that referenced this pull request Jun 30, 2021
…common classes (sonic-net#187)

#### Description
Existing test will mix true swsscommon package with the mocked one in sonic_py_common

#### Motivation and Context
This is blocking sonic-net/sonic-buildimage#7655

#### How Has This Been Tested?
Unit test
andywongarista pushed a commit to andywongarista/sonic-platform-daemons that referenced this pull request Jun 30, 2021
…chassis (sonic-net#188)

#### Description
Following sonic-net#187 to fix the same issue with other packages

#### Motivation and Context
This is blocking sonic-net/sonic-buildimage#7655

#### How Has This Been Tested?
Unit test
@liuh-80
Copy link
Contributor

liuh-80 commented Feb 28, 2022

azp run

@liuh-80
Copy link
Contributor

liuh-80 commented Feb 28, 2022

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@liuh-80
Copy link
Contributor

liuh-80 commented Mar 10, 2022

This PR closed, I will continue this work with another PR: #10099
Because: 1. merge conflict in this PR. 2. the PR is based on a branch in Qi's repo.

@liuh-80 liuh-80 closed this Mar 10, 2022
@liuh-80 liuh-80 mentioned this pull request Mar 10, 2022
6 tasks
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