Skip to content

Commit

Permalink
Remove \n from the end of fs_path in ONIEUpdater (#12465)
Browse files Browse the repository at this point in the history
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 <stephens@nvidia.com>
  • Loading branch information
stephenxs authored Oct 23, 2022
1 parent f39c2ad commit 8c73e68
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def __mount_onie_fs(self):
cmd1 = ['fdisk', '-l']
cmd2 = ['grep', 'ONIE boot']
cmd3 = ['awk', '{print $1}']
fs_path = check_output_pipe(cmd1, cmd2, cmd3)
fs_path = check_output_pipe(cmd1, cmd2, cmd3).rstrip('\n')

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

0 comments on commit 8c73e68

Please sign in to comment.