replace host check command in e1031 (#18279)
This commit is contained in:
parent
5db634beb1
commit
c66acd93b4
@ -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):
|
||||
@ -184,12 +183,13 @@ class Common:
|
||||
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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user