Skip to content

Commit 1e62cff

Browse files
committed
Fix build
Signed-off-by: maipbui <[email protected]>
1 parent ba3c5de commit 1e62cff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

platform/mellanox/mlnx-platform-api/sonic_platform/fan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ def set_speed(self, speed):
218218
addr = utils.read_str_from_file(self.psu_i2c_addr_path, raise_exception=True)
219219
command = utils.read_str_from_file(self.psu_i2c_command_path, raise_exception=True)
220220
speed = self.PSU_FAN_SPEED[int(speed // 10)]
221-
command = "i2cset -f -y {0} {1} {2} {3} wp".format(bus, addr, command, speed)
222-
subprocess.check_call(command, shell = True, universal_newlines=True)
221+
command = ["i2cset", "-f", "-y", bus, addr, command, speed, "wp"]
222+
subprocess.check_call(command, universal_newlines=True)
223223
return True
224224
except subprocess.CalledProcessError as ce:
225225
logger.log_error('Failed to call command {}, return code={}, command output={}'.format(ce.cmd, ce.returncode, ce.output))

platform/mellanox/mlnx-platform-api/tests/test_chassis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def test_revision_permission(self):
276276
#Override the dmi file
277277
sonic_platform.chassis.DMI_FILE = "/tmp/dmi_file"
278278
new_dmi_file = sonic_platform.chassis.DMI_FILE
279-
subprocess.run(["touch ", new_dmi_file])
279+
subprocess.run(["touch", new_dmi_file])
280280
subprocess.run(["chmod", "-r", new_dmi_file])
281281
chassis = Chassis()
282282
rev = chassis.get_revision()

0 commit comments

Comments
 (0)