Fix mount command whitespace (#2126)

This commit is contained in:
codefiles 2023-09-28 07:00:06 -04:00 committed by GitHub
parent 1e296b2637
commit 3695c37bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -546,12 +546,16 @@ class DeviceHandler(object):
info(f'Device already mounted at {target_mountpoint}')
return
str_options = ','.join(options)
str_options = f'-o {str_options}' if str_options else ''
cmd = ['mount']
mount_fs = f'-t {mount_fs}' if mount_fs else ''
if len(options):
cmd.extend(('-o', ','.join(options)))
if mount_fs:
cmd.extend(('-t', mount_fs))
command = f'mount {mount_fs} {str_options} {dev_path} {target_mountpoint}'
cmd.extend((str(dev_path), str(target_mountpoint)))
command = ' '.join(cmd)
debug(f'Mounting {dev_path}: {command}')