Revert "[Mellanox]Check dmi file permission before access (#11309)"

This reverts commit 187f351b23.
This commit is contained in:
Ying Xie 2022-07-06 00:06:45 +00:00
parent 7d06c7f621
commit 296b21ec40
2 changed files with 0 additions and 16 deletions

View File

@ -632,9 +632,6 @@ class Chassis(ChassisBase):
"""
result = {}
try:
if not os.access(filename, os.R_OK):
return result
with open(filename, "rb") as fileobj:
data = fileobj.read()

View File

@ -267,16 +267,3 @@ class TestChassis:
module_list = chassis.get_all_modules()
assert len(module_list) == 3
assert chassis.module_initialized_count == 3
def test_revision_permission(self):
old_dmi_file = sonic_platform.chassis.DMI_FILE
#Override the dmi file
sonic_platform.chassis.DMI_FILE = "/tmp/dmi_file"
new_dmi_file = sonic_platform.chassis.DMI_FILE
os.system("touch " + new_dmi_file)
os.system("chmod -r " + new_dmi_file)
chassis = Chassis()
rev = chassis.get_revision()
sonic_platform.chassis.DMI_FILE = old_dmi_file
os.system("rm -f " + new_dmi_file)
assert rev == "N/A"