Skip to content
Merged
Changes from 6 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
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,11 @@
# components is subject to the terms and conditions of the respective license
# as noted in the Third-Party source code file.

import binascii
import os
import sys
import binascii
import subprocess
from sonic_eeprom import eeprom_tlvinfo

if sys.version_info[0] < 3:
import commands
else:
import subprocess as commands


def fantype_detect():

Expand All @@ -56,9 +51,8 @@ def fantype_detect():
for filename in os.listdir(refpgaTMC_path):
if filename.endswith('_type'):
fantype_path = os.path.join(refpgaTMC_path, filename)
cat_string = "cat "
fantype_string = cat_string + fantype_path
status, fan_type = commands.getstatusoutput(fantype_string)
p = subprocess.run(["cat", fantype_path], capture_output=True, universal_newlines=True)
fan_type = p.stdout
if ((fan_type == AFO) or (fan_type == AFI)):
return fan_type
else:
Expand Down