Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
Signed-off-by: maipbui <[email protected]>
  • Loading branch information
maipbui committed Oct 5, 2022
1 parent ba3c5de commit 1e62cff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions platform/mellanox/mlnx-platform-api/sonic_platform/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ def set_speed(self, speed):
addr = utils.read_str_from_file(self.psu_i2c_addr_path, raise_exception=True)
command = utils.read_str_from_file(self.psu_i2c_command_path, raise_exception=True)
speed = self.PSU_FAN_SPEED[int(speed // 10)]
command = "i2cset -f -y {0} {1} {2} {3} wp".format(bus, addr, command, speed)
subprocess.check_call(command, shell = True, universal_newlines=True)
command = ["i2cset", "-f", "-y", bus, addr, command, speed, "wp"]
subprocess.check_call(command, universal_newlines=True)
return True
except subprocess.CalledProcessError as ce:
logger.log_error('Failed to call command {}, return code={}, command output={}'.format(ce.cmd, ce.returncode, ce.output))
Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/mlnx-platform-api/tests/test_chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def test_revision_permission(self):
#Override the dmi file
sonic_platform.chassis.DMI_FILE = "/tmp/dmi_file"
new_dmi_file = sonic_platform.chassis.DMI_FILE
subprocess.run(["touch ", new_dmi_file])
subprocess.run(["touch", new_dmi_file])
subprocess.run(["chmod", "-r", new_dmi_file])
chassis = Chassis()
rev = chassis.get_revision()
Expand Down

0 comments on commit 1e62cff

Please sign in to comment.