Skip to content

Commit 8c73e68

Browse files
authored
Remove \n from the end of fs_path in ONIEUpdater (#12465)
This fixes the following error ``` admin@sonic:~$ sudo fwutil show status mount: /mnt/onie-fs: special device /dev/sda2 does not exist. Error: Command '['mount', '-n', '-r', '-t', 'ext4', '/dev/sda2\n', '/mnt/onie-fs']' returned non-zero exit status 32.. Aborting... Aborted! admin@sonic:~$ sudo vi /usr/local/lib/python3.9/dist-packages/sonic_platform/ ``` Seems like #11877 the rstrip('\n') was removed. Probably by mistake. Signed-off-by: Stephen Sun <[email protected]>
1 parent f39c2ad commit 8c73e68

File tree

1 file changed

+1
-1
lines changed
  • platform/mellanox/mlnx-platform-api/sonic_platform

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def __mount_onie_fs(self):
172172
cmd1 = ['fdisk', '-l']
173173
cmd2 = ['grep', 'ONIE boot']
174174
cmd3 = ['awk', '{print $1}']
175-
fs_path = check_output_pipe(cmd1, cmd2, cmd3)
175+
fs_path = check_output_pipe(cmd1, cmd2, cmd3).rstrip('\n')
176176

177177
os.mkdir(fs_mountpoint)
178178
cmd = ["mount", "-n", "-r", "-t", "ext4", fs_path, fs_mountpoint]

0 commit comments

Comments
 (0)