mount(): properly handle type
. (forgotten to commit with binfmt mounting)
This commit is contained in:
parent
7f2df127d1
commit
482744feb2
1 changed files with 4 additions and 6 deletions
10
utils.py
10
utils.py
|
@ -23,18 +23,16 @@ def umount(dest):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def mount(src: str, dest: str, options=['bind'], type=None) -> subprocess.CompletedProcess:
|
def mount(src: str, dest: str, options=['bind'], fs_type=None) -> subprocess.CompletedProcess:
|
||||||
opts = []
|
opts = []
|
||||||
type = []
|
|
||||||
|
|
||||||
for opt in options:
|
for opt in options:
|
||||||
opts += ['-o', opt]
|
opts += ['-o', opt]
|
||||||
|
|
||||||
if type:
|
if fs_type:
|
||||||
type = ['-t', type]
|
opts += ['-t', fs_type]
|
||||||
|
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
['mount'] + type + opts + [
|
['mount'] + opts + [
|
||||||
src,
|
src,
|
||||||
dest,
|
dest,
|
||||||
],
|
],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue