Skip to content

Commit

Permalink
[Edgecore][device][platform] Fixed Semgrep check error.
Browse files Browse the repository at this point in the history
Signed-off-by: michael_shih <michael_shih@edge-core.com>
  • Loading branch information
ec-michael-shih committed Dec 1, 2022
1 parent 78d38a9 commit cb06ad5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,6 @@ def __init__(self, component_index=0):
self.index = component_index
self.name = self.get_name()

def __run_command(self, command):
# Run bash command and print output to stdout
try:
process = subprocess.Popen(
shlex.split(command), stdout=subprocess.PIPE)
while True:
output = process.stdout.readline()
if output == '' and process.poll() is not None:
break
rc = process.poll()
if rc != 0:
return False
except Exception:
return False
return True

def __get_bios_version(self):
# Retrieves the BIOS firmware version
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ def pci_get_value(self, resource, offset):
status = False
return status, result

def run_command(self, cmd):
status = True
result = ""
try:
p = subprocess.Popen(
cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
raw_data, err = p.communicate()
if err == '':
result = raw_data.strip()
except Exception:
status = False
return status, result

def run_interactive_command(self, cmd):
try:
os.system(cmd)
Expand Down

0 comments on commit cb06ad5

Please sign in to comment.