diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py index c48102ba19c6..f7bd84b22576 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py @@ -3,7 +3,7 @@ import imp import yaml import subprocess -from shlex import quote, split +from shlex import split from sonic_py_common import device_info @@ -48,7 +48,7 @@ def run_command(self, command): output = "" try: p = subprocess.Popen( - split(quote(command)), stdout=subprocess.PIPE, stderr=subprocess.PIPE) + split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE) raw_data, err = p.communicate() if p.returncode == 0: status, output = True, raw_data.strip() @@ -196,7 +196,7 @@ def write_txt_file(self, file_path, value): return True def is_host(self): - command = split(quote(self.HOST_CHK_CMD)) + command = split(self.HOST_CHK_CMD) return subprocess.run(command).returncode == 0 def load_json_file(self, path): diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/component.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/component.py index ea483063ce1b..cee2a1d18346 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/component.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/component.py @@ -11,7 +11,7 @@ import os.path import shutil import subprocess - from shlex import quote, split + from shlex import split from sonic_platform_base.component_base import ComponentBase except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -40,7 +40,7 @@ def __run_command(self, command): # Run bash command and print output to stdout try: process = subprocess.Popen( - split(quote(command)), universal_newlines=True, stdout=subprocess.PIPE) + split(command), universal_newlines=True, stdout=subprocess.PIPE) while True: output = process.stdout.readline() if output == '' and process.poll() is not None: @@ -65,7 +65,7 @@ def get_register_value(self, register): # Retrieves the cpld register value cmd = "echo {1} > {0}; cat {0}".format(GETREG_PATH, register) p = subprocess.Popen( - split(quote(cmd)), universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + split(cmd), universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) raw_data, err = p.communicate() if err is not '': return None