[202205][Mellanox] change the implementation of is_host() to fix a stuck issue on simx platform #13101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I did it
This PR is to backport #13100 to the 202205 branch since can not be cleanly cherry-picked.
Following code to judge whether a process is running inside a docker could get stuck on the simx platform
When it gets stuck, the config-chassisdb service can not be successfully started, thus the system can not be booted up.
How I did it
Use an alternative way to implement this function and issue can be avoided:
How to verify it
run regression on real hardware and simx platform.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)