Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Common:

SET_METHOD_IPMI = 'ipmitool'
NULL_VAL = 'N/A'
HOST_CHK_CMD = ["docker"]
REF_KEY = '$ref:'

def __init__(self, conf=None):
Expand Down Expand Up @@ -184,12 +183,13 @@ def write_txt_file(self, file_path, value):
return False
return True

def is_host(self):
try:
subprocess.call(self.HOST_CHK_CMD, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except FileNotFoundError:
return False
return True
def is_host():
"""
Test whether current process is running on the host or an docker
return True for host and False for docker
"""
docker_env_file = '/.dockerenv'
return os.path.exists(docker_env_file) is False

def load_json_file(self, path):
"""
Expand Down