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 bug with pcie-check.service #5368

Merged
merged 2 commits into from
Sep 15, 2020

Conversation

bratashX
Copy link
Contributor

@bratashX bratashX commented Sep 14, 2020

Signed-off-by: Petro Bratash [email protected]

- Why I did it
pci-check.service and pcied daemon set different variables in STATE_DB.

  • pci-check.service set "PCIE_STATUS|PCIE_DEVICES" variable with type string,

  • pcied daemon set "PCIE_STATUS|" -> "PCIE_DEVICES" variable with type hash.

- How I did it
Change type for variable with PCI device status from string to hash ("PCIE_STATUS|PCIE_DEVICES" --> "PCIE_DEVICES" "status"), because haven't got API for work with string variable from Python.
- How to verify it

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

  • 201811
  • 201911
  • 202006

- Description for the changelog

Also, in this PR fixed the issues:

  • PCIE_CHK_CMD the variable contains the result of the command work's, and this result cyclically compares with EXPECTED without rescanning devices.

  • Added dependency to database.service, because when pcie-check.service start before database.service will be next error:

pcie-check.sh[912]: Traceback (most recent call last):
pcie-check.sh[912]: File "/usr/bin/pcieutil", line 12, in
pcie-check.sh[912]: sys.exit(cli())
pcie-check.sh[912]: File "/usr/lib/python2.7/dist-packages/click/core.py", line 764, in call
pcie-check.sh[912]: return self.main(*args, **kwargs)
pcie-check.sh[912]: File "/usr/lib/python2.7/dist-packages/click/core.py", line 717, in main
pcie-check.sh[912]: rv = self.invoke(ctx)
pcie-check.sh[912]: File "/usr/lib/python2.7/dist-packages/click/core.py", line 1134, in invoke
pcie-check.sh[912]: Command.invoke(self, ctx)
pcie-check.sh[912]: File "/usr/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
pcie-check.sh[912]: return ctx.invoke(self.callback, **ctx.params)
pcie-check.sh[912]: File "/usr/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
pcie-check.sh[912]: return callback(*args, **kwargs)
pcie-check.sh[912]: File "/usr/lib/python2.7/dist-packages/pcieutil/main.py", line 75, in cli
pcie-check.sh[912]: load_platform_pcieutil()
pcie-check.sh[912]: File "/usr/lib/python2.7/dist-packages/pcieutil/main.py", line 49, in load_platform_pcieutil
pcie-check.sh[912]: platform_path, _ = device_info.get_paths_to_platform_and_hwsku_dirs()
pcie-check.sh[912]: File "/usr/local/lib/python2.7/dist-packages/sonic_py_common/device_info.py", line 213, in get_paths_to_platform_and_hwsku_dirs
pcie-check.sh[912]: hwsku_path = os.path.join(platform_path, hwsku)
pcie-check.sh[912]: File "/usr/lib/python2.7/posixpath.py", line 68, in join
pcie-check.sh[912]: if b.startswith('/'):
pcie-check.sh[912]: AttributeError: 'NoneType' object has no attribute 'startswith'

Related PR: sonic-net/sonic-platform-daemons#93
Fix for: #5349

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

@bratashX
Copy link
Contributor Author

@akokhan @sujinmkang , please review.

@bratashX bratashX changed the title Fix bug with pcie-chack.service Fix bug with pcie-check.service Sep 14, 2020
@jleveque jleveque requested a review from sujinmkang September 14, 2020 17:56
@sujinmkang sujinmkang merged commit 558ec53 into sonic-net:master Sep 15, 2020
@bratashX
Copy link
Contributor Author

@sujinmkang, please update the documentation:

  • 1.4 and 1.5 -- diagrams
  • 1.6 -- command

santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
* Change STATE_DB key (PCIE_STATUS|PCIE_DEVICES -> PCIE_DEVICES)

Signed-off-by: Petro Bratash <[email protected]>

* [pcie-check.service] Add dependency on database.service

Signed-off-by: Petro Bratash <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants