Skip to content

[202012][platform/barefoot] fix faild bring up pcied#8539

Closed
KostiantynYarovyiBf wants to merge 1 commit intosonic-net:202012from
KostiantynYarovyiBf:kyarovyi/barefoot_platform_swi-4328
Closed

[202012][platform/barefoot] fix faild bring up pcied#8539
KostiantynYarovyiBf wants to merge 1 commit intosonic-net:202012from
KostiantynYarovyiBf:kyarovyi/barefoot_platform_swi-4328

Conversation

@KostiantynYarovyiBf
Copy link
Contributor

Why I did it

To fix faild bring up pcied

How I did it

update syntax from pyhton3 to python2

How to verify it

docker exec pmon supervisorctl status

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

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

@ghost
Copy link

ghost commented Aug 20, 2021

CLA assistant check
All CLA requirements met.

@KostiantynYarovyiBf KostiantynYarovyiBf changed the title [202012][platform/barefoot] [202012][platform/barefoot] fix faild bring up pcied Aug 20, 2021
To fix faild bring up pcied

 - How I did it
 - update syntax from pyhton3 to python2
@vboykox
Copy link
Member

vboykox commented Aug 20, 2021

I believe this issue could be fixed with the diff (on both master, 202106 and 202012)

diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2
index b7eca410..1bad4ab3 100644
--- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2
+++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2
@@ -150,7 +150,7 @@ dependent_startup_wait_for=rsyslogd:running
 
 {% if not skip_pcied %}
 [program:pcied]
-command=/usr/local/bin/pcied
+command={% if API_VERSION == 3 and 'pcied' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/pcied
 priority=10
 autostart=false
 autorestart=unexpected

Need to try.

The reason it works on master is that we have dropped python2 support there. so load_platform_pcieutil in pcied script just fallbacks to sonic_platform_base.sonic_platform.pcie version with ImportError on import sonic_plaform stage (not sonic_platform.platform)
Also if we will add own sonic_platform.pcie - it will crash on master. (Since load_platform_pcieutil will attempt to instaniate sonic_platform.platform module with python2)

After doing this we can check if we need supporting py2 in 202012.

@KostiantynYarovyiBf
Copy link
Contributor Author

close this PR by comment @vboykox and add fix for docker-pmon.supervisord.conf.j2 in this PR:
#8543

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