sonic-buildimage/platform
Kebo Liu 9680479661 [Mellanox] change the implementation of is_host() to fix a stuck issue on simx platform (#13100)
- Why I did it
Following code to judge whether a process is running inside a docker could get stuck on the simx platform

subprocess.Popen(["docker", "--version"],
                                stdout=subprocess.PIPE,
                                stderr=subprocess.STDOUT,
                                universal_newlines=True)
When it gets stuck, the config-chassisdb service can not be successfully started, thus the system can not be booted up.

root@sonic:/# service config-chassisdb status
     config-chassisdb.service - Config chassis_db
     Loaded: loaded (/lib/systemd/system/config-chassisdb.service; enabled; vendor preset: enabled)
     Active: activating (start) since Thu 2022-12-15 09:23:02 UTC; 29min ago
   Main PID: 571 (config-chassisd)
      Tasks: 14 (limit: 9501)
     Memory: 132.4M
     CGroup: /system.slice/config-chassisdb.service
                        ├─571 /bin/bash /usr/bin/config-chassisdb
			├─575 /usr/bin/python3 /usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform
			├─602 /bin/sh -c sudo decode-syseeprom -m
			├─603 sudo decode-syseeprom -m
			├─607 /usr/bin/python3 /usr/local/bin/decode-syseeprom -m
			├─616 /bin/sh -c docker --version 2>/dev/null
			└─617 docker --version

- How I did it
Use an alternative way to implement this function and issue can be avoided:

docker_env_file = '/.dockerenv'
return os.path.exists(docker_env_file) is False

- How to verify it
run regression on real hardware and simx platform.
2023-02-04 02:36:43 +08:00
..
barefoot [Arista] Update platform library submodules (#12736) 2022-12-10 10:33:21 +08:00
broadcom [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
cavium [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
centec [centec]: reference to v1.11.0-1 sai debian package for master (#13206) 2023-02-04 02:36:38 +08:00
centec-arm64 [centec]: reference to v1.11.0-1 sai debian package for master (#13206) 2023-02-04 02:36:38 +08:00
checkout Platform/cisco-8000 module for sonic-buildimage (#8172) 2021-08-06 09:11:54 +08:00
components [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699) 2020-06-11 16:04:23 -07:00
innovium [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
marvell [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
marvell-arm64 [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
marvell-armhf [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
mellanox [Mellanox] change the implementation of is_host() to fix a stuck issue on simx platform (#13100) 2023-02-04 02:36:43 +08:00
nephos [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
p4 [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00
pddf Adding support for get/set low power mode for QSFPs in PDDF common APIs (#11786) 2022-09-09 14:33:12 -07:00
s3ip-sysfs The FAN driver framework module complies with s3ip sysfs specification (#12888) (#13212) 2023-01-09 14:24:41 +08:00
template Mount directory warmboot in docker gbsyncd (#11852) 2022-08-26 22:00:45 +08:00
vs [infra] Support syslog rate limit configuration (#12490) (#13535) 2023-01-30 20:11:44 +02:00